forked from finn/tinyboard
offboard-spoke.sh: run as root, remove sudo from python3 install
This commit is contained in:
@@ -78,7 +78,7 @@ DNS_YAML=""
|
||||
IFS=',' read -ra DNS_LIST <<< "$DNS_INPUT"
|
||||
for DNS in "${DNS_LIST[@]}"; do
|
||||
DNS=$(echo "$DNS" | tr -d ' ')
|
||||
DNS_YAML="${DNS_YAML} - ${DNS}\n"
|
||||
DNS_YAML="${DNS_YAML} - ${DNS}"$'\n'
|
||||
done
|
||||
|
||||
info "Current netplan configs:"
|
||||
@@ -113,7 +113,7 @@ if $IS_WIFI; then
|
||||
[ -n "$WIFI_PASS" ] || die "Password cannot be empty"
|
||||
else
|
||||
WIFI_SSID="$CURRENT_SSID"
|
||||
WIFI_PASS=$(grep -A2 "\"${WIFI_SSID}\"" "$NETPLAN_FILE" 2>/dev/null | grep password | awk -F': ' '{print $2}' | tr -d '"' || true)
|
||||
WIFI_PASS=$(grep -FA2 "\"${WIFI_SSID}\"" "$NETPLAN_FILE" 2>/dev/null | grep password | awk -F': ' '{print $2}' | tr -d '"' || true)
|
||||
[ -n "$WIFI_PASS" ] || die "Could not extract WiFi password from existing config — please re-enter credentials."
|
||||
fi
|
||||
fi
|
||||
@@ -140,7 +140,7 @@ network:
|
||||
via: ${GATEWAY}
|
||||
nameservers:
|
||||
addresses:
|
||||
$(printf '%b' "$DNS_YAML") access-points:
|
||||
${DNS_YAML} access-points:
|
||||
"${WIFI_SSID}":
|
||||
password: "${WIFI_PASS}"
|
||||
NETEOF
|
||||
@@ -158,7 +158,7 @@ network:
|
||||
via: ${GATEWAY}
|
||||
nameservers:
|
||||
addresses:
|
||||
$(printf '%b' "$DNS_YAML")
|
||||
${DNS_YAML}
|
||||
NETEOF
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user