The purpose is to restart the machine if it doesn't get an abort command from the user. The problem is that the way the terminals are set up, user must supply SU password for
reboot, etc. commands. We are wondering if it's possible to supply password in bash script itself, maybe using stdin.
#!/bin/bash # (script) echo "Terminal will restart in 60s, Ctrl+C to cancel." sleep 60 su - root -c "init 6" < "password"
We are going to try putting the password in a file and stdin that.
expect are out as solutions as getting them installed will be impossible due to a massive amount of paperwork for permission and a limited timeframe. Also we would like to use
init 6 or
shutdown -r rather than