From ef80ad1a12a14664bd002e9cf6f94c8fba4392b5 Mon Sep 17 00:00:00 2001 From: dmacias72 Date: Thu, 11 Feb 2016 00:25:15 -0700 Subject: [PATCH] update package install script to add shutdown script --- source/shellinabox-plugin/install/doinst.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/shellinabox-plugin/install/doinst.sh b/source/shellinabox-plugin/install/doinst.sh index 1a248525..ed27a911 100644 --- a/source/shellinabox-plugin/install/doinst.sh +++ b/source/shellinabox-plugin/install/doinst.sh @@ -1 +1,14 @@ #!/bin/sh +RC_SCRIPT="/etc/rc.d/rc.shellinaboxd shutdown" +SD_RCFILE="/etc/rc.d/rc.local_shutdown" + +# Update file permissions of scripts +chmod +0755 /usr/local/emhttp/plugins/shellinabox-plugin/scripts/* \ + /etc/rc.d/rc.shellinaboxd \ + /usr/local/bin/screenfetch + +# add stop to shutdown script +if ! grep "$RC_SCRIPT" $SD_RCFILE >/dev/null 2>&1 + then echo -e "\n[ -x $RC_SCRIPT ] && $RC_SCRIPT" >> $SD_RCFILE +fi +[ ! -x $SD_RCFILE ] && chmod u+x $SD_RCFILE