From b5f0e108d119cacf7f5d4ccb2993a1544985abca Mon Sep 17 00:00:00 2001 From: lemniskett Date: Wed, 13 Jan 2021 01:49:53 +0700 Subject: [PATCH] Add support for custom shell script on boot. --- README.md | 4 ++++ archboxinit.bash | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index a3f9249..84db281 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,10 @@ To start services immediately, in Archbox, do : ``` sudo archboxctl exec ``` + +##### Custom command on boot +You can create a shell script located at ```/etc/archbox.rc``` and ```archboxinit``` will execute it in Archbox on boot. + #### Desktop entries Use ```archbox-desktop``` to install desktop entries in chroot to host (installed to ```~/.local/share/applications/archbox```) #### Lauching apps via rofi diff --git a/archboxinit.bash b/archboxinit.bash index fc748e3..f085b58 100644 --- a/archboxinit.bash +++ b/archboxinit.bash @@ -48,6 +48,12 @@ case $1 in chroot $CHROOT /bin/su -c "/usr/local/bin/archboxctl exec $j" > /dev/null 2>&1 & fi done + if [[ -e /etc/archbox.rc ]]; then + cp /etc/archbox.rc /tmp/archbox.rc + chmod +x /tmp/archbox.rc + chroot $CHROOT /bin/su -c '/tmp/archbox.rc' > /tmp/archbox.rc.log 2>&1 + rm /tmp/archbox.rc + fi exit 0 ;; stop)