#!/bin/sh . /etc/functions.sh case "$1" in br_all) ifconfig |grep ^br |while read ifstring;do brif=`echo $ifstring|awk '{ print $1 }'` ifconfig $brif down brctl delbr $brif done ;; qrm) ( kill `cat /var/run/dnsmasq.repeater.pid` killall -KILL hostapd ifconfig ath2 down wlanconfig ath2 destroy ) > /dev/null 2>/dev/null ;; lan) ( kill `cat /var/run/dnsmasq.pid` >/dev/null 2>&1 killall -KILL hostapd ifconfig ath1 down wlanconfig ath1 destroy ) > /dev/null 2>/dev/null ;; wan) ( killall pppd killall -KILL udhcpc ifconfig eth0 0.0.0.0 ps ax | grep '[p]pp' && { sleep 2 killall -KILL pppd } ) > /dev/null 2>/dev/null ;; mgmt) ( ifconfig eth0:1 0.0.0.0 down ) > /dev/null 2>/dev/null ;; hotspot) ( ifconfig ath0 down wlanconfig ath0 destroy ) > /dev/null 2>/dev/null ;; esac