Last active
January 21, 2020 00:28
-
-
Save oakaigh/69f067cbb63783dae32057d3e3f79546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scpinto() { | |
local server args rdir="/" ldir="/tmp/" | |
local options="reconnect,local,allow_other,defer_permissions" | |
while (( $# > 0 )); do | |
case "$1" in | |
-o) options+="-o $1"; shift ;; | |
-*) args+="$1 " ;; | |
*) [ "${server}" ] && args+="$1 " || server="$1" ;; | |
esac; shift | |
done | |
ldir+="/$(uuidgen)" | |
sshfs ${args} -o ${options} -o volname="${server}" ${server}:"${rdir}" "${ldir}" && \ | |
ssh ${args} -t ${server} 'cd '"${rdir}"'; exec "${SHELL}"' && \ | |
open "${ldir}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment