Alkuimista
Occasional Visitor
I put this script in the jffs/scripts folder, in order to restart wan whenever the router is not connected to the internet.
After that I made a wan-start file and I call the scipt from there with :
I don't have physical access to the router, and I made the script through ssh over the internet, but I am seeing the router most of the time down.
Could someone give me some insight on why this script would not work?
Thanks in advanced
EDIT : Is there a simple way of adding the echo line to the log? Because I am accessing the router remotely if the connection drops obviously I can't see it, and only thought about that now!
Code:
#!/bin/bash
x=`ping -c1 google.com 2>&1 | grep unknown`
if [ ! "$x" = "" ]; then
echo "It's down!! Attempting to restart."
service restart_wan
fi
After that I made a wan-start file and I call the scipt from there with :
Code:
#!/bin/sh
sleep 60
/jffs/scripts/connection_check.sh
I don't have physical access to the router, and I made the script through ssh over the internet, but I am seeing the router most of the time down.
Could someone give me some insight on why this script would not work?
Thanks in advanced
EDIT : Is there a simple way of adding the echo line to the log? Because I am accessing the router remotely if the connection drops obviously I can't see it, and only thought about that now!

Last edited: