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

die() {
	echo >&2 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

# having this variable set could cause programs looking for unreachable machines
unset http_proxy

exec "$@"