I got a script for updating firmware that I would like to run before each reboot. However, I want to get user confirmation before the script is actually run.
I put the script in /etc/init.d/ and created a symlink in /etc/rc6.d/ named
S10test. But the script was never run. -- I tested it with
echo "test" >> /root/output.
I also tried creating a file under
/var/lock/subsys with the same name as the script. -- no success.
I then moved on to testing the POC -- if the script could be run, would it work? I tried some simple commands in the built-in
killall script, which does get run.
echo into a file works, but things like
read userinput or
sleep 20 doesn't seem to work. After I run
reboot, the server goes down immediately.
- What am I missing in getting my script to run before reboot?
- Why commands such as
readdid not run? Is there a way to 'pause reboot' if possible?
I'm new to Linux. Links to references or detailed explanation will be much appreciated.