ifupdown-ng/tests/executors/static

18 lines
277 B
Bash
Executable file

#!/bin/sh
case "$PHASE" in
up)
cmd="add"
;;
down)
cmd="del"
;;
esac
for i in $(ifquery -p address -i $INTERFACES_FILE $IFACE); do
echo ip addr $cmd $i dev $IFACE
done
for i in $(ifquery -p gateway -i $INTERFACES_FILE $IFACE); do
echo ip route $cmd default via $i
done