I am working on a battery powered car and want the Pi to shut down
automatically if the battery starts to go flat to try to prevent SD card
corruption. I am a beginner to bash scripts! I will run this via crontab...
#!/bin/bash
powerstatus=$(vcgencmd get_throttled)
if [ $powerstatus="throttled=0x1" ]
then
echo Under Voltage Detected - Shutting Down
sudo halt
else
echo Voltage Normal
fi
Obviously it is not working!! Could someone correct and explain for me
please.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|