Add README.md
This commit is contained in:
parent
be49772f0e
commit
8a12581d6d
1 changed files with 56 additions and 0 deletions
56
README.md
Normal file
56
README.md
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
## Check the internetconnection
|
||||||
|
|
||||||
|
|
||||||
|
### checkconnection.sh
|
||||||
|
|
||||||
|
Check the connection with curl or ping if not available.
|
||||||
|
|
||||||
|
|
||||||
|
### restartmodem.sh
|
||||||
|
|
||||||
|
Restart any given interface of OpenWrt.
|
||||||
|
|
||||||
|
|
||||||
|
## How to install on OpenWrt
|
||||||
|
|
||||||
|
|
||||||
|
### Download scripts and make it executeable
|
||||||
|
|
||||||
|
Wget should be installed by default on OpenWrt. (git works as well, but it's not installed by default.)
|
||||||
|
|
||||||
|
``
|
||||||
|
# wget https://git.datenkastl.org/shell-scripts/checkconnection/raw/branch/main/checkconnection.sh
|
||||||
|
# wget https://git.datenkastl.org/shell-scripts/checkconnection/raw/branch/main/restartmodem.sh
|
||||||
|
# chmod +x checkconnection.sh
|
||||||
|
# chmod +x restartmodem.sh
|
||||||
|
``
|
||||||
|
|
||||||
|
|
||||||
|
### Add restartmodem.sh as failcommand
|
||||||
|
|
||||||
|
Open checkconnection
|
||||||
|
``
|
||||||
|
# vi checkconnection.sh
|
||||||
|
``
|
||||||
|
and add the path to your *restartmodem.sh* at *failcommand=*
|
||||||
|
|
||||||
|
|
||||||
|
### Install curl if desired
|
||||||
|
|
||||||
|
``
|
||||||
|
# opkg update
|
||||||
|
# opkg install curl
|
||||||
|
``
|
||||||
|
|
||||||
|
|
||||||
|
### Add cronjob
|
||||||
|
|
||||||
|
Open crontab
|
||||||
|
``
|
||||||
|
# crontab -e
|
||||||
|
``
|
||||||
|
and add vor example
|
||||||
|
``
|
||||||
|
*/1 * * * * /root/scripts/checkconnection.sh > /dev/zero*
|
||||||
|
``
|
||||||
|
to check the connection every minute and restart the modem if the check fails.
|
Loading…
Reference in a new issue