diff options
-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 |