From 5a0f6aadad25b4fc660b2d9d67aeb02a240e98db Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 10 May 2010 15:52:37 +0200 Subject: [PATCH] *** empty log message *** --- sshmount.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 sshmount.sh 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 -- 2.39.5