Changes between Version 11 and Version 12 of SshfsMnt


Ignore:
Timestamp:
Oct 14, 2015, 12:37:24 PM (3 years ago)
Author:
chris
Comment:

Added GPL notice

Legend:

Unmodified
Added
Removed
Modified
  • SshfsMnt

    v11 v12  
    1111#!/bin/bash
    1212
     13# Mount a filesystem using SSHFS
    1314# 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/>.
    1430
    1531# check that the script is being run by root
     
    4662  echo
    4763  exit 1
    48 fi
    49 
     64fi 
     65   
    5066# check if the mount point exists and if not create it
    5167if [[ ! -d "$MOUNT_POINT/$SERVER" ]]; then
     
    5369  mkdir "$MOUNT_POINT/$SERVER" || { echo "Failed to create $MOUNT_POINT/$SERVER" ; exit 1 ; }
    5470fi
    55 
     71 
    5672# check is the file system appears to already be mounted
    5773DF=$(df | awk -F' ' '{ print $6 }' | grep "$MOUNT_POINT/$SERVER")
     
    6783  # if this failed
    6884  { echo "Problem mounting $SERVER:/ $MOUNT_POINT/$SERVER/" ; exit 1 ; }
     85
     86echo "Oops how did we get here?"
     87exit 1
    6988}}}
    7089
     
    7594#!/bin/bash
    7695
     96# Un-ount a filesystem using SSHFS
    7797# 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/>.
    78113
    79114# check that the script is being run by root
     
    98133  SERVER=$server
    99134fi
    100  
     135
    101136# check if the mount point exists
    102137if [[ ! -d "$MOUNT_POINT/$SERVER" ]]; then
     
    104139  exit 1
    105140fi
    106 
     141 
    107142# check if the file system appears to already be mounted
    108143DF=$(df | awk -F' ' '{ print $6 }' | grep -w "$MOUNT_POINT/$SERVER")
     
    118153  exit 1
    119154fi
     155
     156echo "Oops how did we get here?"
     157exit 1
    120158}}}