add a new event for interface reload
[project/netifd.git] / scripts / ifup
1 #!/bin/sh
2
3 case "$0" in
4         *ifdown) mode=down;;
5         *ifup) mode=up;;
6         *) echo "Invalid command: $0";;
7 esac
8
9 [[ "$1" == "-a" ]] && {
10         for interface in `ubus -S list 'network.interface.*'`; do
11                 ubus call $interface $mode
12         done
13         exit
14 }
15
16 ubus -S list "network.interface.$1" > /dev/null || {
17         echo "Interface $1 not found"
18         exit
19 }
20 ubus call "network.interface.$1" "$mode"