Make router IP address configurable via deploy.conf
Add GATEWAY_IP, GATEWAY_PREFIX, GATEWAY_NETWORK, DHCP_RANGE_START, and DHCP_RANGE_END variables to deploy.conf. Update ap/21-van-br0.network, ap/van-ap-dnsmasq.conf, and ap/nftables.conf to use @TOKEN@ placeholders for IP configuration instead of hardcoding 10.42.x addresses. This allows deploying the same configuration to multiple routers on different networks (e.g., Pi 5 on 10.42.0.x and R5C on 10.42.1.x) by simply editing deploy.conf before running ./deploy.sh. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,11 @@ render() { # render <file> -> stdout, with @TOKEN@ placeholders substituted
|
||||
-e "s|@STARLINK_IFACE@|$STARLINK_IFACE|g" \
|
||||
-e "s|@MODEM_USB_VENDOR@|$MODEM_USB_VENDOR|g" \
|
||||
-e "s|@DNS_RESOLVERS@|$DNS_RESOLVERS|g" \
|
||||
-e "s|@GATEWAY_IP@|$GATEWAY_IP|g" \
|
||||
-e "s|@GATEWAY_PREFIX@|$GATEWAY_PREFIX|g" \
|
||||
-e "s|@GATEWAY_NETWORK@|$GATEWAY_NETWORK|g" \
|
||||
-e "s|@DHCP_RANGE_START@|$DHCP_RANGE_START|g" \
|
||||
-e "s|@DHCP_RANGE_END@|$DHCP_RANGE_END|g" \
|
||||
"$1"
|
||||
}
|
||||
install_rendered() { # install_rendered <src> <dst> [mode]
|
||||
@@ -160,18 +165,21 @@ install -D -m0644 modem/van-sms-watch.service /etc/systemd/system/van-sms-watch.
|
||||
# are PolicyKit-gated). Not a service, just a tool: sudo van-sms-send <number> <text>
|
||||
install -D -m0755 modem/van-sms-send /usr/local/sbin/van-sms-send
|
||||
|
||||
echo "== cockpit plugin =="
|
||||
install -d /usr/share/cockpit/vanrouter
|
||||
for f in cockpit/vanrouter/*; do
|
||||
b=$(basename "$f")
|
||||
if [ "$b" = "vanrouter.js" ]; then
|
||||
install_rendered "$f" "/usr/share/cockpit/vanrouter/$b"
|
||||
else
|
||||
install -m0644 "$f" "/usr/share/cockpit/vanrouter/$b"
|
||||
fi
|
||||
done
|
||||
# Bridge fd headroom (Python bridge frees spawn pipes only at GC; 1024 is too tight)
|
||||
install -D -m0644 cockpit/cockpit-session-nofile.conf /etc/systemd/system/cockpit-session@.service.d/nofile.conf
|
||||
if [ "$SKIP_COCKPIT" -ne "1" ]; then
|
||||
echo "== cockpit plugin =="
|
||||
install -d /usr/share/cockpit/vanrouter
|
||||
for f in cockpit/vanrouter/*; do
|
||||
b=$(basename "$f")
|
||||
if [ "$b" = "vanrouter.js" ]; then
|
||||
install_rendered "$f" "/usr/share/cockpit/vanrouter/$b"
|
||||
else
|
||||
install -m0644 "$f" "/usr/share/cockpit/vanrouter/$b"
|
||||
fi
|
||||
done
|
||||
# Bridge fd headroom (Python bridge frees spawn pipes only at GC; 1024 is too tight)
|
||||
install -D -m0644 cockpit/cockpit-session-nofile.conf /etc/systemd/system/cockpit-session@.service.d/nofile.conf
|
||||
fi
|
||||
|
||||
# The Starlink card queries the dish's gRPC API; grpcurl isn't packaged in apt.
|
||||
command -v grpcurl >/dev/null 2>&1 \
|
||||
|| warn "grpcurl missing (Starlink card will say so): install linux_arm64 binary from github.com/fullstorydev/grpcurl/releases"
|
||||
|
||||
Reference in New Issue
Block a user