From 2d0fedec81deac0fc4145abdba5371c182ef743e Mon Sep 17 00:00:00 2001 From: lemniskett Date: Tue, 3 Nov 2020 22:57:39 +0700 Subject: [PATCH] Fix executing 'enter' in chroot when non-zero return in the last executed command in chroot. --- archboxcommand.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archboxcommand.bash b/archboxcommand.bash index 50a0cf9..7417928 100755 --- a/archboxcommand.bash +++ b/archboxcommand.bash @@ -7,5 +7,5 @@ REQ_ENV="DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/archbox_dbus_session_address) XDG_R ENV="$REQ_ENV $ENV_VAR" COMMAND=$(echo $@ | tr ' ' '\ ') -[[ $1 = "enter" ]] && chroot $CHROOT /sbin/env $ENV /bin/su $USER \ +[[ $1 = "enter" ]] && (chroot $CHROOT /sbin/env $ENV /bin/su $USER; exit 0) \ || chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER