#!/bin/sh echo "This script removes all existing vlans and babelpeers and load a default vlan setup." read -r -p "Do you really want to continue? (y/n) " response case $response in [!Yy]) exit 1 ;; esac # load uci functions . /lib/functions.sh # load board specific properties BOARD="$(uci get board.model.name)" . /etc/network.$BOARD remove_vlan() { local name="$1" uci del gateway.$name } remove_babelpeer() { local name="$1" # remove interface uci -q del gateway.$name } ipaddr=$(uci get gateway.@client[0].ipaddr) ip6addr=$(uci get gateway.@client[0].ip6addr) dhcp_start=$(uci get gateway.@client[0].dhcp_start) essid=$(uci get gateway.@client[0].essid) chan2ghz=$(uci get gateway.@client[0].chan2ghz) chan5ghz=$(uci get gateway.@client[0].chan5ghz) uci del gateway.@client[0] config_load gateway config_foreach remove_vlan vlan config_load gateway config_foreach remove_babelpeer babelpeer uci batch <