Ubuntu Pastebin

Paste from cyphermox at Tue, 11 Oct 2016 20:05:34 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/bin/sh

IP=$1

DEVICE=oldone

# if IP is of the form ::::*, use that interface to bring 
# up the network.
if echo "${IP}" | grep -qe ".*:.*:.*:.*:.*:.*"; then
	if ! echo "${IP}" | grep -q BOOTIF; then
	DEVICE="${IP#*:*:*:*:*:}";
	DEVICE="${DEVICE%%:*}";
	fi
fi

echo IP = $IP
echo DEVICE = $DEVICE
Download as text