Add mount and unmount options.

This commit is contained in:
lemniskett 2021-01-23 16:15:13 +07:00
parent 496514122e
commit 713aa16ddf
2 changed files with 11 additions and 1 deletions

View File

@ -29,7 +29,7 @@ Description=Archbox init
PartOf=multi-user.target PartOf=multi-user.target
[Service] [Service]
ExecStart=/usr/local/share/archbox/bin/archboxinit start ExecStart=<install prefix>/bin/archbox --mount
Type=oneshot Type=oneshot
User=root User=root

View File

@ -33,6 +33,8 @@ OPTIONS:
-c, --create URL Creates a chroot enviroment. -c, --create URL Creates a chroot enviroment.
-e, --enter Enters chroot enviroment. -e, --enter Enters chroot enviroment.
-h, --help Displays this help message. -h, --help Displays this help message.
-m, --mount Mount Archbox directories.
-u, --umount Unmount Archbox directories.
--remount-run Remount /run in chroot enviroment. --remount-run Remount /run in chroot enviroment.
--mount-runtime-only Mount XDG_RUNTIME_DIR to chroot enviroment. --mount-runtime-only Mount XDG_RUNTIME_DIR to chroot enviroment.
@ -95,6 +97,14 @@ case $1 in
$PRIV $PREFIX/share/archbox/bin/archbox enter $PRIV $PREFIX/share/archbox/bin/archbox enter
exit $? exit $?
;; ;;
-m|--mount)
asroot
$PREFIX/share/archbox/bin/archboxinit start
;;
-u|--umount)
asroot
$PREFIX/share/archbox/bin/archboxinit stop
;;
--remount-run) --remount-run)
$PRIV $PREFIX/share/archbox/bin/remount_run $PRIV $PREFIX/share/archbox/bin/remount_run
exit $? exit $?