From ebd343457c0d1bfc8d22199f3dc82aa419f69fb2 Mon Sep 17 00:00:00 2001 From: lemniskett Date: Wed, 11 Nov 2020 20:02:05 +0700 Subject: [PATCH] Add start and stop argument. --- archboxinit.bash | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/archboxinit.bash b/archboxinit.bash index ae4c627..130de5e 100755 --- a/archboxinit.bash +++ b/archboxinit.bash @@ -2,13 +2,30 @@ source /etc/archbox.conf -mount -R /home $CHROOT/home -mount -t proc /proc $CHROOT/proc -mount -R /tmp $CHROOT/tmp -mount -R /sys $CHROOT/sys -mount -R /dev $CHROOT/dev -mount -R /run $CHROOT/run -mount -R /lib/modules $CHROOT/lib/modules -mount -R /boot $CHROOT/boot -mount -R /var/lib/dbus $CHROOT/var/lib/dbus -chroot $CHROOT /usr/local/bin/serviced +case $1 in + start) + mount -R /home $CHROOT/home + mount -t proc /proc $CHROOT/proc + mount -R /tmp $CHROOT/tmp + mount -R /sys $CHROOT/sys + mount -R /dev $CHROOT/dev + mount -R /run $CHROOT/run + mount -R /lib/modules $CHROOT/lib/modules + mount -R /boot $CHROOT/boot + mount -R /var/lib/dbus $CHROOT/var/lib/dbus + chroot $CHROOT /usr/local/bin/serviced >/dev/null 2>&1 + exit 0 + ;; + stop) + umount -R $CHROOT/home + umount -R $CHROOT/proc + umount -R $CHROOT/tmp + umount -R $CHROOT/sys + umount -R $CHROOT/dev + umount -R $CHROOT/run + umount -R $CHROOT/lib/modules + umount -R $CHROOT/boot + umount -R $CHROOT/var/lib/dbus + exit 0 + ;; +esac