Bash script in raspberry pi

Status
Not open for further replies.

hemnath

Advanced Member level 3
Joined
Jun 24, 2012
Messages
702
Helped
61
Reputation
120
Reaction score
57
Trophy points
1,308
Location
Chennai
Activity points
6,588
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?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…