archbox/archboxcommand.bash
2020-10-29 12:10:52 +07:00

9 lines
229 B
Bash
Executable File

#!/bin/bash
source /etc/archbox.conf
ENV="$(cat /tmp/env_archbox)"
COMMAND=$(echo $@ | tr ' ' '\ ')
[[ $1 = "enter" ]] && chroot $CHROOT /sbin/env $ENV /bin/su $USER \
|| chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER