Created
October 20, 2014 11:17
-
-
Save ultramcu/11f962985b218b97159b to your computer and use it in GitHub Desktop.
sshft auto mount
This file contains 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 | |
remote_user=USER_NAME | |
remote_target=SERVER_IP | |
remote_path=SERVER_PATH | |
source_path=LOCAL_PATH | |
mount_name=MOUNT_NAME | |
count=$( ping -c 1 $remote_target | grep icmp* | wc -l ) | |
if [ $count -eq 0 ] | |
then | |
echo "Can not ping server." | |
else | |
echo "Connecting sshfs..." | |
sshfs $remote_user@$remote_target:$remote_path $source_path -ocache=no -onolocalcaches -ovolname=$mount_name | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment