Last active
August 15, 2020 17:24
-
-
Save chrdek/06995686fa5ed36baae9ab3e731ba79d to your computer and use it in GitHub Desktop.
Terminate process for pins from shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GPIO_PIN=10 | |
# stop gpio pins, relevant cmd process | |
ctrl_c() { | |
echo "0" > "/sys/class/gpio/gpio${GPIO_PIN}/value" | |
echo $GPIO_PIN > /sys/class/gpio/unexport | |
exit | |
} | |
# set appropriate OS signal for ctrl-c command | |
trap ctrl_c SIGINT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/tmp/crontab.ppPynM/crontab | |
# cron format supported | |
# minutes hours daymonth dayweek [-optional year] command | |
*/5 * * * * bash ~/bin/sh/gpioterm.sh >> /home/pi/handlerpiStatus.txt 2>&1 | |
0 0 * * * rm /home/pi/handlerpiStatus.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment