Commit 6f30383a authored by fuzzle's avatar fuzzle

Update atftp

parent fe37f4aa
......@@ -7,9 +7,13 @@
# you better have a switch (as the yellow ports on freifunk router do)
#
ver=v2016.2.h.mesh
branch=support
# branch=stable
#ver=v2016.2.x.2
ver=v2017.1.0.d-wg_v14
#ver=v2017.1.0.d-fastd_v14
# branch=support
branch=supportwg
# branch=supportwg
folder=/tftpboot
logf=/var/log/atftp
cpe=http://openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-cpe210-v1.0.bin
......@@ -17,62 +21,95 @@ nd8=http://openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-t
nd9=http://openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v9.bin
nd10=http://openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v10.bin
nd11=http://openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-tl-wr841n-nd-v11.bin
v3=http://openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-tl-wr842n-nd-v3.bin
x710=http://www.openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-tl-wr710n-v1.bin
x941=http://www.openfreiburg.de/freifunk/firmware/$branch/factory/gluon-fffr-${ver}-tp-link-tl-wr941n-nd-v6.bin
echo "###########"
echo "#### usage : $0 <download|cpe|841|all|stop|check> ... first download and than start for cpe or 841"
echo "#### usage : $0 <download|cpe|841|941|710|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"
echo "please install atftp : sudo apt-get install atftp"
fi
sudo tail -f /var/log/atftp &
sudo tcpdump -v -i eth0 |grep "192.168.0" &
sudo ifconfig eth0:23 192.168.1.23 netmask 255.255.255.0
sudo eth0:23 up
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
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
# Download original firmware from TP-Link and rename it to recovery.bin
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.0.100 netmask 255.255.255.0
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.100 --daemon $folder
;;
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 $logf -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder
;;
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 $logf
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder &
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.100 --daemon $folder &
sudo tail -f $logf &
;;
stop)
sudo pkill -e tail
sudo pkill -e tcpdump
sudo pkill -e atftp
;;
check)
sudo ps axa|grep atftp
;;
sudo wget -O $folder/wr841nv11_tp_recovery.bin $nd11
sudo wget -O $folder/wr842nv3_tp_recovery.bin $v3
sudo wget -O $folder/openwrt-ar71xx-generic-tl-wr710n-v1-squashfs-factory.bin $x710
sudo wget -O $folder/wr941ndv6_tp_recovery.bin $x941
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
# Download original firmware from TP-Link and rename it to recovery.bin
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.0.100 netmask 255.255.255.0
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.100 --daemon $folder
;;
710)
# for tplink 710 v1.x
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.1.100 --daemon $folder
;;
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 $logf -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder
;;
842)
# for tplink 842 run with
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.0.66 netmask 255.255.255.0
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder
;;
941)
# wr941ndv6_tp_recovery.bin
sudo ifconfig eth0 up
sudo ifconfig eth0 192.168.0.66 netmask 255.255.255.0
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder
;;
all)
sudo ifconfig eth0:3 192.168.1.66 netmask 255.255.255.0
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:4 192.168.1.100 netmask 255.255.255.0
sudo ifconfig eth0:4 up
sudo ifconfig eth0:1 up
sudo ifconfig eth0:2 up
sudo ifconfig eth0:3 up
sudo touch $logf
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.1.66 --daemon $folder &
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.66 --daemon $folder &
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.0.100 --daemon $folder &
sudo atftpd --logfile $logf -v --no-source-port-checking --trace --bind-address 192.168.1.100 --daemon $folder &
sudo tail -f $logf &
;;
stop)
sudo pkill -e tail
sudo pkill -e tcpdump
sudo pkill -e atftp
;;
check)
sudo ps axa|grep atftp
;;
esac
echo "#################"
......@@ -82,3 +119,5 @@ echo " yellow ports on a working normal gluon flashed 841 wil
echo "you may want to stop process later, try : $0 stop"
echo "you may control atftp is still running : $0 check"
echo "###########"
~
~
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment