From a64f080071b37dad97593dbf4b858e7ce79613b0 Mon Sep 17 00:00:00 2001 From: Vasil Kolev Date: Tue, 29 Oct 2019 15:55:50 +0200 Subject: [PATCH] prepwifi: initial import of crappy script --- prepwifi.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 prepwifi.sh diff --git a/prepwifi.sh b/prepwifi.sh new file mode 100644 index 0000000..6bb90da --- /dev/null +++ b/prepwifi.sh @@ -0,0 +1,28 @@ +#!/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" + +while ! fping ${newip}; do sleep 5; done + +ssh-keygen -R ${newip} +ssh -o stricthostkeychecking=no root@${newip} "opkg remove wpad-mini; opkg update && opkg install ebtables tcpdump bc iftop hostapd-openssl && reboot"