From: Nicolas Boisselier Date: Fri, 24 Jul 2015 14:17:36 +0000 (+0100) Subject: shell_slogin X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=6992f944c274798a059ed5c5f489c3a24f57f13e;p=nb.git shell_slogin --- diff --git a/etc/bashrc.function b/etc/bashrc.function index 02b49860..475446f0 100644 --- a/etc/bashrc.function +++ b/etc/bashrc.function @@ -45,6 +45,7 @@ shell_functions() { } shell_slogin() { + declare ssh_opt; case "$1" in -*) ssh_opt="$1"; shift ;; esac declare server; server="$1"; shift declare tmp; tmp="/tmp/$FUNCNAME.$USER" ( @@ -55,9 +56,10 @@ shell_slogin() { declare args if [ -z "$@" ]; then - slogin -qt "$server" "bash --rcfile $tmp && rm -f $tmp" + [ -z "$ssh_opt" ] && ssh_opt='-t' + ssh $ssh_opt "$server" "bash --rcfile $tmp && rm -f $tmp" else - slogin -qt "$server" "bash && rm -f $tmp" <<< ". $tmp; $@" + ssh $ssh_opt "$server" "bash && rm -f $tmp" <<< ". $tmp; $@" fi }