juliobm algunos videos algunas notas algunos scripts aprendiendo

Telnet script to disable wifi in router Observa Telecom

My son sometimes is connected to internet until several hours past night.
I tried to convince that he needs several hours of sleep… but he is 14 years old…

So the fastest way is disabling wifi at home, and I made it in the easiest way too.

observa_wifi_disable.sh

sh << EOF | telnet 192.168.1.1  
sleep 1  
echo 1234  
sleep 1  
echo password  
echo wlan disable  
sleep 2  
echo exit  
sleep 1  
echo Y  
EOF  

I put this scritp in the crontab of my home server

10 0 * * * sh /home/me/observa_wifi_disable.sh > /home/me/observa_wifi_disable.sh

Then I made another script, same disable but now enabling wifi. Only I had to change wlan disable by wlan enable

Yes, I know. It’s ugly code, but It works with little lines.