mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 07:47:20 +08:00
30 lines
454 B
Bash
30 lines
454 B
Bash
#!/bin/sh
|
|
#
|
|
# ifplugd.action script for Arch Linux
|
|
|
|
. /etc/rc.conf
|
|
. /etc/rc.d/functions
|
|
|
|
plugscript(){ #argumets are ifup|ifdown, interface_name
|
|
for script in /etc/ifplugd/$1.d/*.sh; do
|
|
[ -x $script ] && $script $2
|
|
done
|
|
return 0
|
|
}
|
|
|
|
case "$2" in
|
|
up)
|
|
/etc/rc.d/network ifup $1
|
|
plugscript ifup $1
|
|
;;
|
|
down)
|
|
plugscript ifdown $1
|
|
/etc/rc.d/network ifdown $1
|
|
;;
|
|
*)
|
|
echo "Wrong arguments" > /dev/stderr
|
|
;;
|
|
esac
|
|
|
|
exit 1
|