POSIX rewrite: uth.bash
This commit is contained in:
parent
01f0cb9923
commit
72ab95d4bf
@ -50,7 +50,7 @@ install -v -D -m 755 ./src/exec $PREFIX/share/archbox/bin/exec
|
|||||||
install -v -D -m 755 ./src/enter $PREFIX/share/archbox/bin/enter
|
install -v -D -m 755 ./src/enter $PREFIX/share/archbox/bin/enter
|
||||||
install -v -D -m 755 ./src/chroot_setup $PREFIX/share/archbox/chroot_setup
|
install -v -D -m 755 ./src/chroot_setup $PREFIX/share/archbox/chroot_setup
|
||||||
install -v -D -m 755 ./src/init $PREFIX/share/archbox/bin/init
|
install -v -D -m 755 ./src/init $PREFIX/share/archbox/bin/init
|
||||||
install -v -D -m 755 ./src/uth.bash $PREFIX/share/archbox/bin/uth
|
install -v -D -m 755 ./src/uth $PREFIX/share/archbox/bin/uth
|
||||||
|
|
||||||
grep 'PREFIX=' $ETC_DIR/archbox.conf >/dev/null 2>&1 || cat << EOF >> $ETC_DIR/archbox.conf
|
grep 'PREFIX=' $ETC_DIR/archbox.conf >/dev/null 2>&1 || cat << EOF >> $ETC_DIR/archbox.conf
|
||||||
|
|
||||||
|
31
src/uth
Normal file
31
src/uth
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /etc/archbox.conf >/dev/null 2>&1
|
||||||
|
. /tmp/archbox_env >/dev/null 2>&1
|
||||||
|
|
||||||
|
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 /tmp/archbox_env
|
||||||
|
chmod 755 /tmp/archbox_env
|
||||||
|
;;
|
||||||
|
esac
|
31
src/uth.bash
31
src/uth.bash
@ -1,31 +0,0 @@
|
|||||||
#!/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 /tmp/archbox_env
|
|
||||||
chmod 755 /tmp/archbox_env
|
|
||||||
;;
|
|
||||||
esac
|
|
Loading…
Reference in New Issue
Block a user