diff options
author | tdro <tdro@users.noreply.github.com> | 2020-06-10 03:25:03 -0400 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2020-06-10 03:25:03 -0400 |
commit | 1ab2e557d675169b3e2d8b49caf1df9cf8d752ab (patch) | |
tree | 824184c706818c2cad1f29231663d42bcf61f166 | |
parent | 862b3c7b847e8980ec9d2f305b4af93722da7f44 (diff) | |
download | dotfiles-1ab2e557d675169b3e2d8b49caf1df9cf8d752ab.tar.gz dotfiles-1ab2e557d675169b3e2d8b49caf1df9cf8d752ab.tar.bz2 dotfiles-1ab2e557d675169b3e2d8b49caf1df9cf8d752ab.zip |
.local/bin/scripts: Add sshfs-mount
-rwxr-xr-x | .local/bin/scripts/sshfs-mount | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.local/bin/scripts/sshfs-mount b/.local/bin/scripts/sshfs-mount new file mode 100755 index 0000000..de95aa0 --- /dev/null +++ b/.local/bin/scripts/sshfs-mount @@ -0,0 +1,17 @@ +#!/bin/sh + +input="$1" +host="${input#*@}" +folder="${input%@*}" +mount_path="$HOME/Shares/SSHFS/$folder" + +[ "$2" = 'stop' ] && fusermount -u "$mount_path"; +[ "$2" = 'stop' ] && exit; + +# evaulate the keychain +eval "$(keychain --dir "$HOME"/.cache/keychain --eval --agents ssh -Q --quiet "$HOME"/.ssh/mobile)"; + +# mount the directory +mkdir -p "$mount_path"; +fusermount -u "$mount_path"; +sshfs -f -o follow_symlinks,idmap=user,identityfile="$HOME"/.ssh/mobile,identityfile="$HOME"/.ssh/ansible root@"$host":/ "$mount_path"; |