archbox/uth.bash
2021-05-10 13:38:08 +07:00

32 lines
781 B
Bash

#!/usr/bin/env bash
source /etc/archbox.conf &>/dev/null
source /tmp/archbox_env &>/dev/null
case $1 in
copyresolv)
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
;;
killxdg)
umount -l $CHROOT/run
fuser -km $XDG_RUNTIME_DIR
exit $?
;;
runtimeonly)
mkdir -p $CHROOT$XDG_RUNTIME_DIR
umount -Rl $CHROOT$XDG_RUNTIME_DIR 2>/dev/null
mount | grep $CHROOT$XDG_RUNTIME_DIR || \
mount --rbind $XDG_RUNTIME_DIR $CHROOT$XDG_RUNTIME_DIR
exit $?
;;
remountrun)
umount -l $CHROOT/run 2>/dev/null
mount --rbind /run $CHROOT/run
exit $?
;;
chownvar)
chown $2:$2 /tmp/archbox_env
chmod 755 /tmp/archbox_env
;;
esac