#!/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 } config_load gateway config_foreach remove_vlan vlan config_load gateway config_foreach remove_babelpeer babelpeer uci batch <