ipv6 allow firewall
[automated-distro-installer] / wrt-setup
index 746b16f29e84966720cbe21bcb4427b548958d4d..9ac518afca061bf9f20a3928eb4c557f26f2e25e 100755 (executable)
--- a/wrt-setup
+++ b/wrt-setup
@@ -23,28 +23,41 @@ x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*}
 
 usage() {
   cat <<EOF
-usage: ${0##*/} [-h|--help] [HOST/IP]
+usage: ${0##*/} [-h|--help] [HOST/IP] [wrt-setup-local_ARGS]
 setup my router in general: dhcp, dns, etc.
+
+Default HOST is root@10.0.0.1
+
+Note, use -m "''" to send an empty mac arg. When we get a new enough
+bash, we can use ${@@Q} to properly pass an empty var.
+
 EOF
+  wrt-setup-local -h
   exit $1
 }
 
 h=root@10.0.0.1
 
-if [[ $1 ]]; then
-  case $1 in
-    -h|--help) usage ;;
-    *) h=root@$1 ;;
-  esac
-fi
+case $1 in
+  -h|--help) usage ;;
+  -*) : ;;
+  ?*) h="$1"; shift ;;
+esac
+
+echo "$0: host=$h"
 
 cat ~/.ssh/home.pub | ssh $h dd of=/etc/dropbear/authorized_keys 2>/dev/null
-scp /a/bin/fai/wrt-setup-local /a/bin/cedit/cedit $h:/usr/bin
+scp /a/work/libremanage/libremanage /a/bin/fai/wrt-setup-local /a/bin/cedit/cedit $h:/usr/bin
+# relay is built for openwrt 18.06.2, r7676-cddd7b4c77
+sudo scp /q/root/shadow/router /p/c/machine_specific/wrt/etc/dropbear/dropbear_rsa_host_key \
+     /a/opt/openwrt/source/bin/packages/mips_24kc/mypackages/relay_1.0-1_mips_24kc.ipk $h:
 ssh $h <<EOF
+set -x
 if ! opkg list-installed|grep bash; then
     opkg update
     opkg install bash
 fi
 export HOME_DOMAIN=$HOME_DOMAIN
-wrt-setup-local
+export WIRELESSMAC=$WIRELESSMAC
+wrt-setup-local $@
 EOF