diff --git a/archbox.bash b/archbox.bash index e66876e..fea7b0f 100644 --- a/archbox.bash +++ b/archbox.bash @@ -98,16 +98,20 @@ case $1 in exit $? ;; -m|--mount) + storeenv $PRIV $PREFIX/share/archbox/bin/archboxinit start ;; -u|--umount) + storeenv $PRIV $PREFIX/share/archbox/bin/archboxinit stop ;; --remount-run) + storeenv $PRIV $PREFIX/share/archbox/bin/remount_run exit $? ;; --mount-runtime-only) + storeenv $PRIV $PREFIX/share/archbox/bin/remount_run runtimeonly exit $? ;; diff --git a/remount_run.bash b/remount_run.bash index 3ecca47..0bd8d1c 100644 --- a/remount_run.bash +++ b/remount_run.bash @@ -1,17 +1,19 @@ #!/usr/bin/env bash source /etc/archbox.conf +source /tmp/archbox_env case $1 in killxdg) umount -l $CHROOT/run - fuser -km $(cat /tmp/archbox_xdg_runtime_dir) + fuser -km $XDG_RUNTIME_DIR exit $? ;; runtimeonly) - mkdir -p $CHROOT/$(cat /tmp/archbox_xdg_runtime_dir) - umount -Rl $CHROOT/$(cat /tmp/archbox_xdg_runtime_dir) - mount --rbind $(cat /tmp/archbox_xdg_runtime_dir) $CHROOT/$(cat /tmp/archbox_xdg_runtime_dir) + 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 $? ;; *)