diff options
author | Jonas Smedegaard <dr@jones.dk> | 2016-10-22 16:23:57 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2016-10-22 16:45:50 +0200 |
commit | 4f6ddfb335eb1b423e45380acc7029b6d1901dd4 (patch) | |
tree | eb4f0e1c2fe326ecdced329e9a211c8c5dd2645c | |
parent | 1e2e5d80a02c2806c4a988920b4f1094f9108dec (diff) |
Simplify wrap su (was and still is broken in local use, unrelated to this change).
-rwxr-xr-x | xsh | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -46,6 +46,9 @@ done [ $# -gt 0 ] || set -- /bin/bash +# FIXME: needs shell wrapper (provided by SSH but not in local use) +[ -z "$SU" ] || set -- "echo -n 'Changing to root...: '; su -c \"cd; "$@"\"" + [ -z "$SUDO" ] || set -- sudo -i -- "$@" # Split program name from its options @@ -61,21 +64,12 @@ if [ "$V" = 1 ]; then fi prg="$prg_base $prg_opts" -prg_su="echo -n 'Changing to root...: '; su -c \"cd; $prg\"" case "$HOST" in '') - if [ -n "$SU" ]; then - termwrapper $prg_su - else - termwrapper $prg - fi + termwrapper $prg ;; *) - if [ -n "$SU" ]; then - termwrapper ssh $ssh_opts $HOST $prg_su - else - termwrapper ssh $ssh_opts $HOST $prg - fi + termwrapper ssh $ssh_opts $HOST $prg ;; esac |