jfrog

watchdog.sh

Oct 24th, 2020
424
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. #for example WE825-Q watchdog gpio is 2
  4. wd_gpio="2"
  5.  
  6. echo $wd_gpio > /sys/class/gpio/export
  7. echo out > /sys/class/gpio/gpio$wd_gpio/direction
  8.  
  9. while [ 1 ]
  10. do
  11.     echo 1 >/sys/class/gpio/gpio$wd_gpio/value
  12.     sleep 1
  13.     echo 0 >/sys/class/gpio/gpio$wd_gpio/value
  14.     sleep 1
  15.    
  16.     echo 1 >/sys/class/gpio/gpio$wd_gpio/value
  17.     sleep 1
  18.     echo 0 >/sys/class/gpio/gpio$wd_gpio/value
  19.     sleep 1
  20.    
  21.     echo 1 >/sys/class/gpio/gpio$wd_gpio/value
  22.     sleep 1
  23.     echo 0 >/sys/class/gpio/gpio$wd_gpio/value
  24.     sleep 1
  25. done
  26.  
RAW Paste Data