hemnath
Advanced Member level 3
Hi,
I have a bash script running at startup and it is included in rc.local.
The script has options like. When some condition fails, it power OFF the system.
Part of code:
Code: Select all
if [ $match = 1 ]
then
echo "OK"
else
echo "NOT OK"
sudo halt -p
fi
If match is not 1, then power OFF the system.
In some cases, if that condition happens, I want to bypass the system power off by entering some password. It should wait for 10 seconds for keyboard input for password entering. if password is wrong or nothing typed within 10 seconds, it should halt the system. How can it done?
I have a bash script running at startup and it is included in rc.local.
The script has options like. When some condition fails, it power OFF the system.
Part of code:
Code: Select all
if [ $match = 1 ]
then
echo "OK"
else
echo "NOT OK"
sudo halt -p
fi
If match is not 1, then power OFF the system.
In some cases, if that condition happens, I want to bypass the system power off by entering some password. It should wait for 10 seconds for keyboard input for password entering. if password is wrong or nothing typed within 10 seconds, it should halt the system. How can it done?