2019-10-29 15:55:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo Usage: $0 IP name
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
ip=${1}
|
|
|
|
name=${2}
|
|
|
|
|
|
|
|
cd "out/${name}/files" || exit 3
|
|
|
|
|
|
|
|
newip=`grep ipaddr etc/config/network |tail -n1|cut -d \' -f 2`
|
|
|
|
|
|
|
|
if [ -z "$newip" ]; then
|
|
|
|
echo ip not found
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
ssh-keygen -R ${ip}
|
|
|
|
ssh -o stricthostkeychecking=no root@${ip} uptime
|
|
|
|
scp -r * root@${ip}:/
|
|
|
|
ssh root@${ip} "/etc/init.d/wifi-sentinel enable; /etc/init.d/odhcpd disable; /etc/init.d/dnsmasq disable; reboot"
|
|
|
|
|
2019-10-29 15:59:26 +02:00
|
|
|
sleep 3
|
2019-10-29 15:55:50 +02:00
|
|
|
while ! fping ${newip}; do sleep 5; done
|
|
|
|
ssh-keygen -R ${newip}
|
2019-10-29 15:59:26 +02:00
|
|
|
sleep 3
|
|
|
|
|
2019-10-30 17:49:47 +02:00
|
|
|
ssh -o stricthostkeychecking=no root@${newip} "opkg remove wpad-mini; opkg remove wpad; opkg update && opkg install ebtables tcpdump bc iftop hostapd-openssl collectd collectd-mod-iwinfo collectd-mod-interface collectd-mod-cpu collectd-mod-exec collectd-mod-load collectd-mod-memory collectd-mod-network && reboot"
|