X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=wrt-setup-local;h=4cad00c1797158040c6ec1f66dc90d9a321eaf70;hp=b8d36e02b2bd6bd23b29366945db079a939156c3;hb=53db7c23cb11661c98a08d69295bb315c392003b;hpb=cef9b6ede5c1e028bed1b4dc7895f5dfa121ad6b diff --git a/wrt-setup-local b/wrt-setup-local index b8d36e0..4cad00c 100755 --- a/wrt-setup-local +++ b/wrt-setup-local @@ -39,15 +39,19 @@ EOF +dnsmasq_restart=false +firewall_restart=false dev2=false test=false libremanage_host=wrt2 -if [[ -e /p/router-secrets ]]; then - source /p/router-secrets +secrets=false +if [[ -e /root/router-secrets ]]; then + secrets=true + source /root/router-secrets fi rmac=$(cat /sys/class/net/eth0/address) -if [[ $rhost ]]; then +if $secrets; then hostname=${rhost[$rmac]} fi : ${hostname:=wrt} @@ -83,10 +87,10 @@ while getopts hm:t: opt; do done shift "$((OPTIND-1))" # Discard the options and sentinel -- -if [[ ! $mac ]] && ! $test; then +if [[ ! $mac ]] && ! $test && $secrets; then # if we wanted to increment it - #WIRELESSMAC=${WIRELESSMAC:0: -1}$((${WIRELESSMAC: -1} + 2)) - mac=$WIRELESSMAC + #mac=${mac:0: -1}$((${mac: -1} + 2)) + mac=${rwmac[$rmac]} fi if (( $# != 0 )); then @@ -183,17 +187,23 @@ udel() { ### network config ### -ssid="check out gnu.org" lan=10.0.0.0 if $test; then - ssid="gnuv3" lan=10.1.0.0 elif [[ $hostname == cmc ]]; then - ssid=Svenska lan=10.2.0.0 fi -if [[ $rkey ]]; then +if $test; then + ssid="gnuv3" +elif $secrets; then + ssid=${rssid[$rmac]} +fi + +: ${ssid:=librecmc} + + +if $secrets; then key=${rkey[$rmac]} fi : ${key:=pictionary49} @@ -437,17 +447,32 @@ config wireguard_wg0 'wgclient' EOF -firewall_restart=false firewall-cedit() { - v cedit /etc/config/firewall </dev/null; then fi -dnsmasq_restart=false + v cedit /etc/hosts <