]> git.nbdom.net Git - nb.git/commitdiff
shell_slogin
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 24 Jul 2015 14:17:36 +0000 (15:17 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 24 Jul 2015 14:17:36 +0000 (15:17 +0100)
etc/bashrc.function

index 02b49860872f1e5795d23bbd9c7fe1a82c10fe40..475446f008f397990bf57b9f7676efdda617885a 100644 (file)
@@ -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
 }