Skip to content

Commit

Permalink
added messages that can be seen in service status for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
RogueM committed Mar 24, 2017
1 parent b52e406 commit de6956e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/usr/bin/cleanshutd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ DISCLAIMER
# Checking whether daemon should be active

if [ $(grep -c "disable_cleanshutd=1" /boot/config.txt) -gt 0 ]; then
echo "cleanshutd is disabled in /boot/config.txt"
exit 1
elif [ $(grep -c "daemon_active=0" /etc/cleanshutd.conf) -gt 0 ]; then
echo "cleanshutd is disabled in /etc/cleanshutd.conf"
exit 1
else
daemon="on"
Expand Down Expand Up @@ -54,6 +56,8 @@ raspi-gpio set $trigger_pin ip pu

# Monitoring trigger and calling shutdown

echo "monitoring BCM $trigger_pin"

while [ $daemon = "on" ]; do
if [ $(raspi-gpio get $trigger_pin | grep -c "level=0 fsel=0 func=INPUT") = 1 ]; then
echo "BCM $trigger_pin asserted low, system shutdown in $shutdown_delay minutes"
Expand Down

0 comments on commit de6956e

Please sign in to comment.