DD-WRT:Triggertftp

IMAGE=dd-wrt.v24_generic-8184.bin OLD=192.168.2.1 NEW=192.168.1.1 INTERFACE=eth0 set -e if test -f "$IMAGE" then echo $IMAGE exists starting ping loop else echo file: $IMAGE doesnot exist >&2 exit 2 fi CURRENT_IP=`ip addr show "$INTERFACE"| awk '$1 == "inet" { print $2}'` if test -z "$CURRENT_IP" then echo "Interface address for $INTERFACE not found." >&2       exit 2 fi count=0 until ping -c 2 -i .2 -n -w 60 $OLD || test $count -gt 5 do       count=$(( $count + 1)) done atftp --option "mode octet" --option "timeout 60" --verbose --trace -p -l "$IMAGE" "$OLD" sleep 120 ping -c 1 $OLD if test $? -eq 0 then echo old address is still responding, probably tftp boot failed >&2 exit 3 else # hardcoded # using class c addressing ip addr del $CURRENT_IP dev  $INTERFACE ip addr add ${NEW}/24 dev $INTERFACE ping -c 4 $NEW nmap $NEW fi
 * 1) small script to help with tftp boot, change out the values of the variable at the top to your values
 * 2) the use of an intermediate switch is highly recommended
 * 3) IMAGE=f5d7230-4_4.03.03.bin
 * 4) IMAGE=dd-wrt.v24-9517_VINT_mini_usb.bin
 * 1) f5d7230-4_4.03.03.bin
 * 2) current IP of the router
 * 1) address of the router if it flashes successfully
 * 1) interface on the machine providing the tftp boot and where this script is being run.
 * 1) waiting longer than needed x2