updated on Thu Jan 5 13:17:10 UTC 2012
[aur-mirror.git] / macaddr / macaddr.rc
blob5441ac3b804b0ecda8cc3f590ceaea72307b1feb
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 . /etc/conf.d/macaddr
8 case "$1" in
9 start)
10 STARTNET=
11 if ! ck_daemon network; then
12 /etc/rc.d/network stop
13 sleep 1
14 STARTNET=true
16 stat_busy "Start MAC address"
17 for DEVICE in ${interfaces_mac}; do
18 eval DEVICEMAC=\$\{${DEVICE}_mac\}
19 /sbin/ifconfig ${DEVICE} down hw ether ${DEVICEMAC}
20 done
21 stat_done
22 add_daemon macaddr
23 [ "${STARTNET}" == "true" ] && /etc/rc.d/network start
25 stop)
26 stat_busy "Stop MAC address"
27 stat_done
28 rm_daemon macaddr
30 restart)
31 $0 stop
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac