2020-10-27 06:12:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source /etc/archbox.conf
|
2020-10-28 16:06:06 +00:00
|
|
|
|
2020-10-29 06:07:50 +00:00
|
|
|
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"
|
2020-11-11 03:51:06 +00:00
|
|
|
COMMAND="$@"
|
2020-11-03 15:57:39 +00:00
|
|
|
[[ $1 = "enter" ]] && (chroot $CHROOT /sbin/env $ENV /bin/su $USER; exit 0) \
|
2020-10-29 06:07:50 +00:00
|
|
|
|| chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER
|