Created
January 30, 2015 03:38
-
-
Save warpfork/42c6970121fd7e952c30 to your computer and use it in GitHub Desktop.
sshfs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p "${locPath}" && \ | |
trap '( fusermount -u "${locPath}" && rmdir "${locPath}" ) 2>/dev/null ; exit $?' INT TERM EXIT && \ | |
( | |
declare -a opts | |
opts=(); | |
opts+=("-o sshfs_sync"); # synchronous writes | |
opts+=("-o no_readahead"); # synchronous reads | |
opts+=("-o reconnect"); # try harder | |
opts+=("-f"); # run in foreground | |
#opts+=("-d"); # debug, so i know you're alive | |
sshfs \ | |
"${rmtWho}"@"${rmtHost}":"$rmtPath" \ | |
"${locPath}" \ | |
${opts[@]} \ | |
|| { echo "mount attempt asploded :'(" 1>&2 ; exit 3; } | |
) && \ | |
echo "mounted! :D" 1>&2 #&& \ | |
#while true; do sleep 10; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment