ifupdown-ng/tests/executors/static
2020-07-26 02:37:39 -06:00

18 lines
277 B
Bash

#!/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