Another way to escape spaces in command.

This commit is contained in:
lemniskett 2020-11-11 10:51:06 +07:00
parent b3242949e6
commit 6c9e20617f
2 changed files with 2 additions and 4 deletions

View File

@ -100,7 +100,6 @@ case $1 in
*) *)
storeenv storeenv
copyresolv copyresolv
COMMAND=$(echo $@ | tr ' ' '\ ') $PRIV /usr/local/share/archbox/bin/archbox $@
$PRIV /usr/local/share/archbox/bin/archbox $COMMAND
;; ;;
esac esac

View File

@ -5,7 +5,6 @@ source /etc/archbox.conf
REQ_ENV="DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/archbox_dbus_session_address) XDG_RUNTIME_DIR=$(cat /tmp/archbox_xdg_runtime_dir)" REQ_ENV="DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/archbox_dbus_session_address) XDG_RUNTIME_DIR=$(cat /tmp/archbox_xdg_runtime_dir)"
ENV="$REQ_ENV $ENV_VAR" ENV="$REQ_ENV $ENV_VAR"
COMMAND="$@"
COMMAND=$(echo $@ | tr ' ' '\ ')
[[ $1 = "enter" ]] && (chroot $CHROOT /sbin/env $ENV /bin/su $USER; exit 0) \ [[ $1 = "enter" ]] && (chroot $CHROOT /sbin/env $ENV /bin/su $USER; exit 0) \
|| chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER || chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER