diff --git a/script/_dhcpv6_pd_ref b/script/_dhcpv6_pd_ref index 4d4e13fea06..06ccda8880c 100644 --- a/script/_dhcpv6_pd_ref +++ b/script/_dhcpv6_pd_ref @@ -2,18 +2,14 @@ customise_dhcpcd_conf() { + # This has to be run after script/_border_routing, and this will + # invalidate all changes to dhcpcd.conf made by script/_border_routing. sudo tee /etc/dhcpcd.conf >/dev/null </dev/null; then + # dhcpv6-pd + without DHCPV6_PD_REF || { sudo apt-get install --no-install-recommends -y dhcpcd sudo mkdir -p /etc/systemd/system/dhcpcd.service.d # allow edit system config file eg. /etc/radvd.conf @@ -118,7 +118,7 @@ EOF # reload dhcpcd daemon to activate the custom.conf sudo systemctl daemon-reload sudo apt-get install --no-install-recommends -y radvd - fi + } # network-manager without NETWORK_MANAGER || sudo apt-get install --no-install-recommends -y dnsmasq network-manager diff --git a/script/reference-device/dhcpcd.enter-hook b/script/reference-device/dhcpcd.enter-hook index 99566b33b36..bd02ccc65e2 100644 --- a/script/reference-device/dhcpcd.enter-hook +++ b/script/reference-device/dhcpcd.enter-hook @@ -1,7 +1,6 @@ #!/bin/bash -WAN_INTERFACE="eth0" -WLAN_INTERFACE="wlan0" +UPSTREAM_INTERFACE="eth0" WPAN_INTERFACE="wpan0" RADVD_CONF="/etc/radvd.conf" @@ -29,7 +28,8 @@ EOF } -if [ "${interface}" = "eth0" ] || [ “${interface}” = “wlan0” ]; then +# TODO: set the upstream interface according to the environment variables of `script/setup`. +if [ "${interface}" = ${UPSTREAM_INTERFACE} ]; then for var in $(env); do # Split the variable into name and value diff --git a/script/reference-device/dhcpcd.exit-hook b/script/reference-device/dhcpcd.exit-hook index 8aba12527d5..ce79b9385cd 100644 --- a/script/reference-device/dhcpcd.exit-hook +++ b/script/reference-device/dhcpcd.exit-hook @@ -2,8 +2,7 @@ #dhcpcd.exit-hook -WAN_INTERFACE="eth0" -WLAN_INTERFACE="wlan0" +UPSTREAM_INTERFACE="eth0" WPAN_INTERFACE="wpan0" RADVD_CONF="/etc/radvd.conf" @@ -29,7 +28,9 @@ interface ${WPAN_INTERFACE} EOF } -if [ “${interface}” = “eth0” ] || [ “${interface}” = “wlan0” ]; then + +# TODO: set the upstream interface according to the environment variables of `script/setup`. +if [ “${interface}” = ${UPSTREAM_INTERFACE} ]; then for var in $(env); do # Split the variable into name and value