aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-unshare-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'pbuilder-unshare-wrapper')
-rwxr-xr-xpbuilder-unshare-wrapper21
1 files changed, 21 insertions, 0 deletions
diff --git a/pbuilder-unshare-wrapper b/pbuilder-unshare-wrapper
new file mode 100755
index 0000000..ffa25c8
--- /dev/null
+++ b/pbuilder-unshare-wrapper
@@ -0,0 +1,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 "$@"