Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # AUTO RANDOM MAC ADDRESS
- #!/bin/ash
- MAC=`(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
- echo "00:${MAC}"
- ifconfig eth1 hw ether 00:${MAC}
- nvram set def_hwaddr="00:${MAC}"
- nvram set wan_hwaddr="00:${MAC}"
- stopservice wan
- startservice wan
- # AUTO CLEAR NVRAM
- for i in `nvram show | grep traff- | cut -f1 -d=""`; do nvram unset $i; done
- # SPEAK SIGNAL STRENGTH
- #! /bin/bash
- # Use "festival" to say out loud how much signal strength we have
- # The IP address of the WRT
- ip_addr="10.0.0.1"
- # The username and password for the WRT
- user="Admin"
- pass="password"
- # Tempory file used to hold the data from the WRT
- tmp_file=/tmp/wrt.status
- echo
- echo "The signal level is:-"
- echo
- echo "The signal level is" | festival --tts
- while true ; do
- wget --http-user=$user --http-password=$pass http://$ip_addr/Status_Wireless.live.asp -O $tmp_file -o /dev/null
- signal=`awk -F "'" '/active_wireless/ { print }' $tmp_file`
- echo $signal | awk '{printf"Signal : ""\t";for(;j<;j++)printf"=";printf"\n"}'
- if [[ -n $signal ]] ; then
- echo $signal | festival --tts
- else
- echo "Not associated" | festival --tts
- fi
- done
- #!/bin/sh
- # This script solves an intermitent problem on my
- # NetGear WNDR3300 wireless N radio. Every few
- # hours, the wireless N radio stops broadcasting
- # and cannot be seen by wireless clients. Bringing
- # the wireless interface down and then back up
- # resolves the issue. This script pings a
- # wireless client, in my case, a WET610N wireless
- # bridge that should always remain up and only
- # connects to the wireless N radio. If the
- # ping fails twice within a given time, it
- # brings the interface down and then back up.
- # A wireless client that should always be up
- CLIENT_IP=192.168.1.1
- # Wireless interface that disappears
- INTERFACE=`nvram get wl0_ifname`
- # seconds to wait after failed ping to try again
- FAIL_AGAIN=10
- # seconds between checks
- CHECK_EVERY=60
- # after cycling, wait this many seconds
- AFTER_CYCLE=360
- # Client must be up before starting main loop
- while true
- do
- if ping -c 1 ${CLIENT_IP} >/dev/null
- then
- echo "${CLIENT_UP} ok - begining main loop"
- break
- fi
- done
- # main script
- while sleep ${CHECK_EVERY}
- do
- if ping -c 1 ${CLIENT_IP} >/dev/null
- then
- echo "${CLIENT_IP} ok"
- else
- echo "${CLIENT_IP} dropped one"
- sleep ${FAIL_AGAIN}
- if ! ping -c 1 ${CLIENT_IP} >/dev/null
- then
- echo "${CLIENT_IP} dropped two, sending restarting ${INTERFACE}"
- # on Atheros hardware instead use: ifconfig ${INTERFACE} down
- wl -i ${INTERFACE} down
- sleep 3
- # on Atheros hardware instead use: ifconfig ${INTERFACE} up
- wl -i ${INTERFACE} up
- sleep ${AFTER_CYCLE}
- fi
- fi
- done 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement