forked from freifunk-franken/firmware
48 lines
901 B
Bash
48 lines
901 B
Bash
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
. /lib/functions/fff/switchports
|
|
|
|
# skip if gateway configuration already exists
|
|
if [ -s /etc/config/gateway ]; then
|
|
exit 0
|
|
fi
|
|
|
|
touch /etc/config/gateway
|
|
|
|
essid='noservice.freifunk'
|
|
chan2ghz='1'
|
|
chan5ghz='36'
|
|
|
|
uci batch <<EOF
|
|
set gateway.meta='gateway'
|
|
set gateway.meta.config_version='2'
|
|
|
|
add gateway client
|
|
set gateway.@client[0].vlan='1'
|
|
set gateway.@client[0].essid='$essid'
|
|
set gateway.@client[0].chan2ghz='$chan2ghz'
|
|
set gateway.@client[0].chan5ghz='$chan5ghz'
|
|
|
|
add gateway wan
|
|
set gateway.@wan[0].vlan='2'
|
|
|
|
set gateway.1=vlan
|
|
set gateway.1.comment='client'
|
|
set gateway.1.ports='$BATMAN_PORTS $CLIENT_PORTS'
|
|
set gateway.2=vlan
|
|
set gateway.2.comment='wan'
|
|
set gateway.2.ports='$WAN_PORTS'
|
|
|
|
add gateway dns
|
|
add_list gateway.@dns[0].server='fd43:5602:29bd:ffff:1:1:1:1'
|
|
EOF
|
|
|
|
# TODO: one-port
|
|
# TODO: two-port
|
|
# TODO: dsa
|
|
|
|
uci commit gateway
|
|
|
|
exit 0
|