Changes between Version 5 and Version 6 of SshfsMnt


Ignore:
Timestamp:
Jul 23, 2015, 2:21:20 PM (3 years ago)
Author:
chris
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SshfsMnt

    v5 v6  
    5757sshfs $SERVER:/ $MOUNT_POINT/$SERVER/
    5858}}}
     59
     60== Unmount ==
     61
     62{{{
     63#!/bin/bash
     64
     65# http://fuse.sourceforge.net/sshfs.html
     66
     67# the place file systems are to be mounted
     68MOUNT_POINT="/media"
     69if [[ ! -d "$MOUNT_POINT" ]]; then
     70  echo "It looks like $MOUNT_POINT doesn't exist?"
     71  exit
     72fi
     73
     74# check for server to unmount on standard input
     75if [[ $1 ]]; then
     76  SERVER=$1
     77elif [[ ! $1 ]]; then
     78  echo "Type the server you want to unmount and then [ENTER]:"
     79  read server
     80  SERVER=$server
     81fi
     82
     83# check if the file system appears to already be mounted
     84DF=$(df | awk -F' ' '{ print $6 }' | grep "$MOUNT_POINT/$SERVER")
     85if [[ $DF ]]; then
     86  echo "Umounting $SERVER at $DF?"
     87  fusermount -u $MOUNT_POINT/$SERVER
     88  exit
     89else
     90  echo "It appears that $SERVER is not mounted"
     91fi
     92}}}