Router reboot wrapper script
This is a memory sink article. I found this nice python script which reboots a B525 router and wanted to write a wrapper script around it. #!/bin/bash # refs: https://github.com/jinxo13/HuaweiB525Router, https://github.com/mkorz/b618reboot RUNDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MAX_ATTEMPTS=10 ATTEMPT=0 TIMEOUT=60 LOCK_FILE=$RUNDIR/lock REMOTE=google.com LOCAL=192.168.7.1 if [ -f $LOCK_FILE ]; then echo "Already running, exiting" exit -1 fi function finish { rm $RUNDIR/lock } trap finish EXIT touch $RUNDIR/lock while (( $ATTEMPT < $MAX_ATTEMPTS )) do DATE=$(date +%Y%d%m-%H%M%S) echo -e "GET http://$REMOTE HTTP/1....