Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. WIFI_DEVICE=$2
  4. START_TIME=$3
  5. END_TIME=$4
  6. CURR_TIME=$(date +"%H")
  7.  
  8. case "$1" in
  9. start)
  10. uci set wireless.radio0.disabled='0'; uci commit wireless; wifi
  11. echo "Wifi started!"
  12. ;;
  13. stop)
  14. uci set wireless.radio0.disabled='1'; uci commit wireless; wifi
  15. echo "Wifi stopped!"
  16. ;;
  17. check)
  18. if [ $CURR_TIME -gt $START_TIME ] && [ $CURR_TIME -lt $END_TIME ]
  19. then
  20. echo "Current Time: $CURR_TIME is between given Starttime ($START_TIME) and Endtime ($END_TIME)! Enabling Wifi.."
  21. uci set wireless.radio0.disabled='0'; uci commit wireless; wifi
  22. echo "Wifi enabled!"
  23. else
  24. echo "Current Time: $CURR_TIME is NOT between given Starttime ($START_TIME) and Endtime ($END_TIME)! Disabling Wifi.."
  25. uci set wireless.radio0.disabled='1'; uci commit wireless; wifi
  26. echo "Wifi disabled!"
  27. fi
  28. ;;
  29. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement