From: Francois Fleuret Date: Mon, 10 May 2010 13:52:37 +0000 (+0200) Subject: *** empty log message *** X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a0f6aadad25b4fc660b2d9d67aeb02a240e98db;p=scripts.git *** empty log message *** --- diff --git a/sshmount.sh b/sshmount.sh new file mode 100755 index 0000000..ea0b0cc --- /dev/null +++ b/sshmount.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +################################################################## +# START_IP_HEADER # +# # +# Written by Francois Fleuret # +# Contact for comments & bug reports # +# # +# END_IP_HEADER # +################################################################## + +set -e + +hostname=$1 +remotepath=$2 + +localpath=/tmp/sshfs/${hostname}/${remotepath} + +if [[ $(mount | grep ${hostname}:${remotepath}) ]]; then + fusermount -u ${localpath} + echo "${localpath} is unmounted." +else + mkdir -p ${localpath} + sshfs -o idmap=user -C ${hostname}:${remotepath} ${localpath} + echo "${localpath} is mounted." +fi