mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Minor, edit comments
This commit is contained in:
parent
f9f0924d34
commit
ef20f3dd6f
@ -3,35 +3,31 @@
|
|||||||
# When wireless client AP mode is enabled, this script handles starting up network services in a specific order and timing to avoid race conditions.
|
# When wireless client AP mode is enabled, this script handles starting up network services in a specific order and timing to avoid race conditions.
|
||||||
# Todo: update /etc/rc.local script with /bin/bash /usr/local/bin/hostapdstart.sh to enable at system startup
|
# Todo: update /etc/rc.local script with /bin/bash /usr/local/bin/hostapdstart.sh to enable at system startup
|
||||||
|
|
||||||
# Make sure services are not running
|
|
||||||
echo "Stopping network services..."
|
echo "Stopping network services..."
|
||||||
systemctl stop hostapd.service
|
systemctl stop hostapd.service
|
||||||
systemctl stop dnsmasq.service
|
systemctl stop dnsmasq.service
|
||||||
systemctl stop dhcpcd.service
|
systemctl stop dhcpcd.service
|
||||||
|
|
||||||
# Check that no uap0 interface exists
|
|
||||||
echo "Removing uap0 interface..."
|
echo "Removing uap0 interface..."
|
||||||
iw dev uap0 del
|
iw dev uap0 del
|
||||||
|
|
||||||
# Add uap0 interface
|
|
||||||
echo "Adding uap0 interface..."
|
echo "Adding uap0 interface..."
|
||||||
iw dev wlan0 interface add uap0 type __ap
|
iw dev wlan0 interface add uap0 type __ap
|
||||||
|
|
||||||
# Modify iptables (todo: persist to /etc/rc.local as with default rules)
|
# Add iptables rules (todo: persist to /etc/rc.local as with default rules)
|
||||||
echo "IPV4 forwarding: setting..."
|
echo "IPV4 forwarding: setting..."
|
||||||
sysctl net.ipv4.ip_forward=1
|
sysctl net.ipv4.ip_forward=1
|
||||||
echo "Editing IP tables..."
|
echo "Editing IP tables..."
|
||||||
iptables -t nat -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE
|
iptables -t nat -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE
|
||||||
|
|
||||||
# Enable uap0 interface
|
# Bring up uap0 interface
|
||||||
ifconfig uap0 up
|
ifconfig uap0 up
|
||||||
|
|
||||||
# Start hostapd, mitigating race condition
|
# Start services, mitigating race conditions
|
||||||
echo "Starting hostapd service..."
|
echo "Starting hostapd service..."
|
||||||
systemctl start hostapd.service
|
systemctl start hostapd.service
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# Start dhcpcd
|
|
||||||
echo "Starting dhcpcd service..."
|
echo "Starting dhcpcd service..."
|
||||||
systemctl start dhcpcd.service
|
systemctl start dhcpcd.service
|
||||||
sleep 5
|
sleep 5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user