#!/bin/sh echo "`uptime | awk -F" " '{print $1}'`: entering ifdown" >>/tmp/.startup_log . /etc/functions.sh case "$1" in ath2) echo "`uptime | awk -F" " '{print $1}'`: $0 bringing down $1 and its components" >>/tmp/.startup_log killall wpa_supplicant iwconfig ath2 channel 0 ifconfig ath2 down ;; ath1) echo "`uptime | awk -F" " '{print $1}'`: $0 bringing down $1 and its components" >>/tmp/.startup_log kill `cat /var/run/dnsmasq.pid` killall -KILL hostapd iwconfig ath1 channel 0 ifconfig ath1 0.0.0.0 down ;; ath0) echo "`uptime | awk -F" " '{print $1}'`: $0 bringing down $1 and its components" >>/tmp/.startup_log kill `cat /var/run/dnsmasq_tun0.pid` ifconfig ath0 down ;; eth0) echo "`uptime | awk -F" " '{print $1}'`: $0 bringing down $1 and its components" >>/tmp/.startup_log killall pppd killall -KILL udhcpc kill `cat /var/run/dnsmasq.repeater.pid` ifconfig eth0 0.0.0.0 ps ax | grep '[p]pp' && { sleep 2 killall -KILL pppd } ;; eth0:1) echo "`uptime | awk -F" " '{print $1}'`: $0 bringing down $1 and its components" >>/tmp/.startup_log ifconfig eth0:1 down ;; br_all) echo "`uptime | awk -F" " '{print $1}'`: $0 bringing down all bridges (\"$1\") and their components" >>/tmp/.startup_log ifconfig |grep ^br |while read ifstring;do brif=`echo $ifstring|awk '{ print $1 }'` ifconfig $brif down brctl delbr $brif done ;; esac