Skip to content

Instantly share code, notes, and snippets.

@YourFriendCaspian
Forked from ducin/sshfs.sh
Created September 2, 2017 04:08
Show Gist options
  • Select an option

  • Save YourFriendCaspian/9abd58dafa0115998b747857a956fe18 to your computer and use it in GitHub Desktop.

Select an option

Save YourFriendCaspian/9abd58dafa0115998b747857a956fe18 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