add more interactive
This commit is contained in:
parent
8a85838433
commit
059c7d6e58
|
@ -2,8 +2,6 @@
|
||||||
# https://raspberrypi.stackexchange.com/questions/88954/workaround-for-a-wifi-bridge-on-a-raspberry-pi-with-proxy-arp
|
# https://raspberrypi.stackexchange.com/questions/88954/workaround-for-a-wifi-bridge-on-a-raspberry-pi-with-proxy-arp
|
||||||
# https://www.willhaley.com/blog/raspberry-pi-wifi-ethernet-bridge/
|
# https://www.willhaley.com/blog/raspberry-pi-wifi-ethernet-bridge/
|
||||||
|
|
||||||
# TODO: non-interactive install
|
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Config
|
# Config
|
||||||
|
|
||||||
|
@ -34,11 +32,24 @@ fi
|
||||||
# We only need to get the $WLAN_IFACE IP address and will copy it over to $ETH_IFACE later
|
# We only need to get the $WLAN_IFACE IP address and will copy it over to $ETH_IFACE later
|
||||||
WLAN_IFACE_IP=$(ip -4 -br addr show $WLAN_IFACE | grep -Po "\\d+\\.\\d+\\.\\d+\\.\\d+")
|
WLAN_IFACE_IP=$(ip -4 -br addr show $WLAN_IFACE | grep -Po "\\d+\\.\\d+\\.\\d+\\.\\d+")
|
||||||
|
|
||||||
|
if $NON_INTERACTIVE; then
|
||||||
|
NON_INTERACTIVE_APT="-y"
|
||||||
|
else
|
||||||
|
NON_INTERACTIVE_APT=""
|
||||||
|
fi
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Install stuff
|
# Install stuff
|
||||||
|
|
||||||
echo "# INSTALL THINGS #"
|
echo "# INSTALL THINGS #"
|
||||||
|
|
||||||
|
echo -e "\nUpdating...\n\n"
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get upgrade $NON_INTERACTIVE_APT
|
||||||
|
|
||||||
|
echo -e "\n"
|
||||||
|
|
||||||
THINGS_TO_INSTALL="parprouted dhcp-helper net-tools"
|
THINGS_TO_INSTALL="parprouted dhcp-helper net-tools"
|
||||||
|
|
||||||
if ! $NON_INTERACTIVE; then
|
if ! $NON_INTERACTIVE; then
|
||||||
|
@ -48,7 +59,7 @@ fi
|
||||||
|
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
|
|
||||||
apt-get install $THINGS_TO_INSTALL
|
apt-get install $NON_INTERACTIVE_APT $THINGS_TO_INSTALL
|
||||||
|
|
||||||
echo -e "\n\nSetting up services...\n"
|
echo -e "\n\nSetting up services...\n"
|
||||||
|
|
||||||
|
@ -61,7 +72,7 @@ if ! $NON_INTERACTIVE; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
apt-get --autoremove -y purge ifupdown dhcpcd5 isc-dhcp-client isc-dhcp-common
|
apt-get --autoremove $NON_INTERACTIVE_APT purge ifupdown dhcpcd5 isc-dhcp-client isc-dhcp-common
|
||||||
|
|
||||||
echo -e "\n\nConnecting to WiFi..."
|
echo -e "\n\nConnecting to WiFi..."
|
||||||
|
|
||||||
|
@ -107,7 +118,7 @@ DHCP=yes
|
||||||
EOF
|
EOF
|
||||||
echo "Created network config: $WLAN_IFACE"
|
echo "Created network config: $WLAN_IFACE"
|
||||||
echo -e "Finishing systemd-networkd install...\n\n"
|
echo -e "Finishing systemd-networkd install...\n\n"
|
||||||
apt-get install -y libnss-resolve
|
apt-get install $NON_INTERACTIVE_APT libnss-resolve
|
||||||
systemctl enable --now systemd-resolved.service
|
systemctl enable --now systemd-resolved.service
|
||||||
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||||
systemctl enable --now systemd-networkd.service
|
systemctl enable --now systemd-networkd.service
|
||||||
|
@ -119,13 +130,6 @@ echo -e "\n\nInstall complete! Ignore any service errors for now..."
|
||||||
|
|
||||||
echo -e "\n# BRIDGE $WLAN_IFACE TO $ETH_IFACE #"
|
echo -e "\n# BRIDGE $WLAN_IFACE TO $ETH_IFACE #"
|
||||||
|
|
||||||
# brctl addbr br0
|
|
||||||
# brctl addif br0 $WLAN_IFACE
|
|
||||||
# brctl addif br0 $ETH_IFACE
|
|
||||||
# ip addr flush dev $WLAN_IFACE
|
|
||||||
# ip addr flush dev $ETH_IFACE
|
|
||||||
# ip link set dev br0 up
|
|
||||||
|
|
||||||
# IP="128.198.192.233"
|
# IP="128.198.192.233"
|
||||||
# MAC="f0:1f:af:6d:fd:54"
|
# MAC="f0:1f:af:6d:fd:54"
|
||||||
# ebtables -F
|
# ebtables -F
|
||||||
|
|
Loading…
Reference in New Issue