summaryrefslogtreecommitdiffstats
path: root/share/examples/slattach/unit-command.sh
blob: 9e97ffdcd69617076e311172c8b72abc72c69bc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

old_unit=$1
new_unit=$2

if [ $old_unit != -1 ]; then
	ifconfig sl$old_unit delete down
	if [ $new_unit == -1 ]; then
		route delete default
	fi
fi

if [ $new_unit != -1 ]; then
	ifconfig sl$new_unit <address1> <address2>
	if [ $old_unit == -1 ]; then
		route add default <address2>
	fi
fi
OpenPOWER on IntegriCloud