adamchilcott icon

sshfsSwitch.sh

adamchilcott | PRO | 10/10/17 02:09:38 PM UTC | 0 ⭐ | 1086 👁️ | Never ⏰ | []
Bash |

640 B

|

None

|

0 👍

/

0 👎

#!/usr/bin/env bash
 
#######################################
# Simple SSHFS-Mount Conditional Switch
#######################################
 
if [ -d "/tmp/sshfs" ]; then
    sh "$HOME/Scripts/sshfs-mount/sshfs-mount" unmount
    sleep 1
    rm --recursive /tmp/sshfs
else
    mkdir /tmp/sshfs
    sleep 1
    modprobe fuse
    sh "$HOME/Scripts/sshfs-mount/sshfs-mount" mount
fi
 
#############
# START NOTES
#############
 
## This script is targeted at embedded SoC devices, hence 'modprobe fuse'.
## It relies upon the hardwork of <https://github.com/thefekete>.
## <https://github.com/thefekete/sshfs-mount>.
 
###########
# END NOTES
###########

Comments