summaryrefslogtreecommitdiffstats
path: root/sftp-mount.sh
blob: 75e892826835d65632d4f602ce68d6296cdc5b17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

set -e

for i in "$@"; do
	mnt=~/mnt/$i

	if ! mountpoint -q $mnt; then
		mkdir -p $mnt
		sshfs -o reconnect,kernel_cache web-$i@karif: $mnt
	else
		fusermount -u $mnt
		rmdir $mnt
	fi
done