Skip to content

Instantly share code, notes, and snippets.

@ducin
Created January 22, 2014 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ducin/8554814 to your computer and use it in GitHub Desktop.
Save ducin/8554814 to your computer and use it in GitHub Desktop.
simple script opening/closing sshfs connection with ./sshfs.sh -o or ./sshfs.sh -c
#!/bin/bash
if [ "$1" != "" ]; then
case $1 in
-o | --open ) echo "$USER opening sshfs connection"
open your connection here
;;
-c | --close ) echo "$USER closing sshfs connection"
close your connection here
;;
-h | --help ) echo "Use one of the options: -o/--open or -c/--close"
esac
else
echo "No option chosen"
echo "Use one of the options: -o/--open or -c/--close"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment