"$@"
}
+######### uci example:#######
+# # https://wiki.openwrt.org/doc/uci
+# wan_index=$(uci show firewall | sed -rn 's/firewall\.@zone\[([0-9])+\]\.name=wan/\1/p')
+# wan="firewall.@zone[$wan_index]"
+# if [[ $(uci get firewall.@forwarding[0].dest) != $forward_dest ]]; then
+# # default is wan
+# v uci set firewall.@forwarding[0].dest=$forward_dest
+# uci commit firewall
+# firewall_restart=true
+# fi
+####### end uci example #####
+
+uset() {
+ local key="$1"
+ local val="$2"
+ local service="${key%%.*}"
+ restart_var=${service}_restart
+ if [[ ! ${!restart_var} ]]; then
+ eval $restart_var=false
+ fi
+ if [[ $(uci get "$key") != "$val" ]]; then
+ v uci set "$key"="$val"
+ uci commit $service
+ eval $restart_var=true
+ fi
+}
+
+
### network config
###
ssid="check out gnu.org"
lan=10.0.0.0
if $dev2; then
- ssid="test1"
+ ssid="gnuv3"
lan=10.1.0.0
fi
mask=255.255.0.0
passwd -l root ||: #already locked fails
+sed -ibak '/^root:/d' /etc/shadow
+# /root/router created by manually running passwd then copying the resulting
+# line. We have no mkpasswd on wrt/librecmc, then we scp it in.
+cat /root/router >>/etc/shadow
+# otherwise, serial console gets root login with no password
+uset system.@system[0].ttylogin 1
+
+
cat >/usr/bin/archlike-pxe-mount <<'EOFOUTER'
#!/bin/bash
# symlinks are collapsed for nfs mount points, so use a bind mount.
-######### uci example:#######
-# # https://wiki.openwrt.org/doc/uci
-# wan_index=$(uci show firewall | sed -rn 's/firewall\.@zone\[([0-9])+\]\.name=wan/\1/p')
-# wan="firewall.@zone[$wan_index]"
-# if [[ $(uci get firewall.@forwarding[0].dest) != $forward_dest ]]; then
-# # default is wan
-# v uci set firewall.@forwarding[0].dest=$forward_dest
-# uci commit firewall
-# firewall_restart=true
-# fi
-
-
-uset() {
- local key="$1"
- local val="$2"
- local service="${key%%.*}"
- restart_var=${service}_restart
- if [[ ! ${!restart_var} ]]; then
- eval $restart_var=false
- fi
- if [[ $(uci get "$key") != "$val" ]]; then
- v uci set "$key"="$val"
- uci commit $service
- eval $restart_var=true
- fi
-}
uset dropbear.@dropbear[0].PasswordAuth 0
uset dropbear.@dropbear[0].RootPasswordAuth 0
firewall_restart=false
v cedit /etc/config/firewall <<EOF || firewall_restart=true
+
+
config redirect
option name ssh
option src wan
$l.5 x2
$l.6 demohost
$l.7 x3
-$l.8 tp faiserver b8.nz
+$l.8 tp b8.nz faiserver
+$l.9 bb8
72.14.176.105 li
# netns creation looks for next free subnet starting at 10.173, but I only