Changes between Version 11 and Version 12 of SshfsMnt
- Timestamp:
- Oct 14, 2015, 12:37:24 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SshfsMnt
v11 v12 11 11 #!/bin/bash 12 12 13 # Mount a filesystem using SSHFS 13 14 # http://fuse.sourceforge.net/sshfs.html 15 # 16 # Copyright 2015 Chris Croome 17 # 18 # This program is free software: you can redistribute it and/or modify 19 # it under the terms of the GNU General Public License as published by 20 # the Free Software Foundation, either version 3 of the License, or 21 # (at your option) any later version. 22 # 23 # This program is distributed in the hope that it will be useful, 24 # but WITHOUT ANY WARRANTY; without even the implied warranty of 25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 # GNU General Public License for more details. 27 # 28 # You should have received a copy of the GNU General Public License 29 # along with this program. If not, see <http://www.gnu.org/licenses/>. 14 30 15 31 # check that the script is being run by root … … 46 62 echo 47 63 exit 1 48 fi 49 64 fi 65 50 66 # check if the mount point exists and if not create it 51 67 if [[ ! -d "$MOUNT_POINT/$SERVER" ]]; then … … 53 69 mkdir "$MOUNT_POINT/$SERVER" || { echo "Failed to create $MOUNT_POINT/$SERVER" ; exit 1 ; } 54 70 fi 55 71 56 72 # check is the file system appears to already be mounted 57 73 DF=$(df | awk -F' ' '{ print $6 }' | grep "$MOUNT_POINT/$SERVER") … … 67 83 # if this failed 68 84 { echo "Problem mounting $SERVER:/ $MOUNT_POINT/$SERVER/" ; exit 1 ; } 85 86 echo "Oops how did we get here?" 87 exit 1 69 88 }}} 70 89 … … 75 94 #!/bin/bash 76 95 96 # Un-ount a filesystem using SSHFS 77 97 # http://fuse.sourceforge.net/sshfs.html 98 # 99 # Copyright 2015 Chris Croome 100 # 101 # This program is free software: you can redistribute it and/or modify 102 # it under the terms of the GNU General Public License as published by 103 # the Free Software Foundation, either version 3 of the License, or 104 # (at your option) any later version. 105 # 106 # This program is distributed in the hope that it will be useful, 107 # but WITHOUT ANY WARRANTY; without even the implied warranty of 108 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 109 # GNU General Public License for more details. 110 # 111 # You should have received a copy of the GNU General Public License 112 # along with this program. If not, see <http://www.gnu.org/licenses/>. 78 113 79 114 # check that the script is being run by root … … 98 133 SERVER=$server 99 134 fi 100 135 101 136 # check if the mount point exists 102 137 if [[ ! -d "$MOUNT_POINT/$SERVER" ]]; then … … 104 139 exit 1 105 140 fi 106 141 107 142 # check if the file system appears to already be mounted 108 143 DF=$(df | awk -F' ' '{ print $6 }' | grep -w "$MOUNT_POINT/$SERVER") … … 118 153 exit 1 119 154 fi 155 156 echo "Oops how did we get here?" 157 exit 1 120 158 }}}