aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-unshare-wrapper
blob: ffa25c853bd57ccbfd81b14c20722b04bfca4802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

die() {
	echo >&@ E: $2 returned error code $1
	echo >&2 N: Could not set up the loopback interface.
	exit 1
}

if test -x /sbin/ifconfig; then
	/sbin/ifconfig lo up || die $? ifconfig
elif test -x /sbin/ip; then
	/sbin/ip link set lo up || die $? ip
elif test -x /bin/ip; then
	/bin/ip link set lo up || die $? ip
else
	echo >&2 E: Neither ifconfig nor ip found.
	echo >&2 N: Could not set up the loopback interface.
	exit 1
fi

exec "$@"