Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- WIFI_DEVICE=$2
- START_TIME=$3
- END_TIME=$4
- CURR_TIME=$(date +"%H)
- case "$1" in
- start)
- uci set wireless.radio0.disabled='0'; uci commit wireless; wifi
- echo "Wifi started!"
- ;;
- stop)
- uci set wireless.radio0.disabled='1'; uci commit wireless; wifi
- echo "Wifi stopped!"
- ;;
- check)
- if [ $CURR_TIME -gt $START_TIME ] && [ $CURR_TIME -lt $END_TIME ]
- then
- uci set wireless.radio0.disabled='0'; uci commit wireless; wifi
- echo "Wifi enabled"
- else
- uci set wireless.radio0.disabled='1'; uci commit wireless; wifi
- echo "Wifi disabled"
- fi
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement