Hi mein quick and dirty linux script für atftp um schnell recovery zu flashen …
dazu Router vom Strom trennen und bei gedrücktem reset button und angeschlossenem LAN mit tftp einschalten.
(dazu die einschlägigen Dokus lesen auf openwrt und co)
ihr müsstet eure wunsch fw noch anpassen, danach das script starten mit
< atftp-script > download
< atftp-script > all
später dann auch
< atftp-script > stop
#!/bin/bash
# you maybe have to deactivate inetd in /etc/default/atftp
# you maybe want to open second terminal watch : tail /var/log/syslog -f
# if youre really curious : sudo tcpdump -i eth0 -v |grep 192.168
#
# because your ethernet card is lousy (in coming up fast)
# you better have a switch (as the yellow ports on freifunk router do well)
#
ver=v2016.1.5
folder=/tftpboot
cpe=http://openfreiburg.de/freifunk/firmware/support/factory/gluon-fffr-${ver}-tp-link-cpe210-v1.0.bin
nd8=http://openfreiburg.de/freifunk/firmware/support/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v8.bin
nd9=http://openfreiburg.de/freifunk/firmware/support/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v9.bin
nd10=http://openfreiburg.de/freifunk/firmware/support/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v10.bin
nd11=http://openfreiburg.de/freifunk/firmware/support/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v11.bin
echo "###########"
echo "#### usage : $0 <download|cpe|841|all|stop|check> ... first download and than start for cpe or 841"
echo "###########"
# check atftp is installed
if [ $(whereis atftp |grep bin |wc -l) = 0 ] ; then
echo "please install atftp : sudo apt-get install atftp"
fi
case "$1" in
download)
sudo mkdir -p $folder
sudo wget -O $folder/mr3420v2_tp_recovery.bin $nd8
sudo wget -O $folder/wr841nv9_tp_recovery.bin $nd9
sudo wget -O $folder/wr841nv10_tp_recovery.bin $nd10
sudo wget -O $folder/wr841nv11_tp_recovery.bin $nd11
sudo wget -O $folder/recovery.bin $cpe
# whats with cpe210v1.1
echo "please check if cpe210v1.1 also work like cpe210v1"
;;
cpe|cpe210)
# for cpe210
# Set PC to fixed ip address 192.168.0.100
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.0.100 netmask 255.255.255.0
sudo atftpd --logfile /var/log/atftp -v --no-source-port-checking --trace --bind-address 192.168.0.100 --daemon $folder
sudo tail -f /var/log/atftp &
;;
841)
# for tplink 841 run with
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.0.66 netmask 255.255.255.0
sudo atftpd --logfile /var/log/atftp -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder &
sudo tail -f /var/log/atftp &
;;
all)
sudo ifconfig eth0:1 192.168.0.66 netmask 255.255.255.0
sudo ifconfig eth0:2 192.168.0.100 netmask 255.255.255.0
sudo ifconfig eth0:1 up
sudo ifconfig eth0:2 up
sudo touch /var/log/atftp
sudo atftpd --logfile /var/log/atftp -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder &
sudo atftpd --logfile /var/log/atftp -v --no-source-port-checking --trace --bind-address 192.168.0.100 --daemon $folder &
sudo tail -f /var/log/atftp &
;;
stop)
sudo pkill -e tail
sudo pkill -e atftp
;;
check)
sudo ps axa|grep atftp
;;
esac
echo "#################"
echo "you may want to killall atftp or look if atftp is still running, maybe you need a while true loop."
echo "you may need a switch in between , because your laptops eth is too slowly coming up"
echo " yellow ports on a working normal gluon flashed 841 will do fine"
echo "you may want to stop process later, try : $0 stop"
echo "you may control atftp is still running : $0 check"
echo "###########"
offensichtlich in dieser Form nur für cpe210v1, 841v8-10 … die anderen müsste man selber rausfinden welche datei die auf welcher IP haben wollten.