Skip to content

Commit

Permalink
semi-automated PD on raspbian scripts: bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsong-cnyn committed Oct 14, 2024
1 parent 1a32672 commit b0b15d8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
11 changes: 3 additions & 8 deletions script/_dhcpv6_pd_ref
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
noipv6rs
# disable routing solicitation
# disable router solicitation
interface eth0
ipv6rs
iaid 1
ia_pd 2/::/64 -
interface wlan0
ipv6rs
iaid 2
ia_pd 3/::/64 -
EOF
}

Expand All @@ -40,5 +36,4 @@ dhcpv6_pd_ref_install()
# Add dhcpcd.hooks
sudo install -m 755 "$(dirname "$0")"/reference-device/dhcpcd.enter-hook /etc/dhcpcd.enter-hook
sudo install -m 755 "$(dirname "$0")"/reference-device/dhcpcd.exit-hook /etc/dhcpcd.exit-hook

}
6 changes: 3 additions & 3 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ install_packages_apt()
fi
}

# dhcpv6 pd
with DHCPV6_PD_REF && if command -v apt-get &>/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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions script/reference-device/dhcpcd.enter-hook
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

WAN_INTERFACE="eth0"
WLAN_INTERFACE="wlan0"
UPSTREAM_INTERFACE="eth0"
WPAN_INTERFACE="wpan0"

RADVD_CONF="/etc/radvd.conf"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions script/reference-device/dhcpcd.exit-hook
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#dhcpcd.exit-hook


WAN_INTERFACE="eth0"
WLAN_INTERFACE="wlan0"
UPSTREAM_INTERFACE="eth0"
WPAN_INTERFACE="wpan0"

RADVD_CONF="/etc/radvd.conf"
Expand All @@ -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
Expand Down

0 comments on commit b0b15d8

Please sign in to comment.