*** empty log message ***
authorFrancois Fleuret <francois@fleuret.org>
Mon, 10 May 2010 13:52:37 +0000 (15:52 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Mon, 10 May 2010 13:52:37 +0000 (15:52 +0200)
sshmount.sh [new file with mode: 0755]

diff --git a/sshmount.sh b/sshmount.sh
new file mode 100755 (executable)
index 0000000..ea0b0cc
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+##################################################################
+# START_IP_HEADER                                                #
+#                                                                #
+# Written by Francois Fleuret                                    #
+# Contact <francois.fleuret@idiap.ch> 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