aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-unshare-wrapper
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-06-17 19:21:48 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-06-17 20:31:24 +0000
commitad50ac00a531dbe60260c63760388ce6dac12361 (patch)
treee45df26ce8c8c6b90ece685231bf86df2acc75f1 /pbuilder-unshare-wrapper
parent935740912f47d9dc9f0ea337a3a11cc5f0a9e988 (diff)
downloadpbuilder-ad50ac00a531dbe60260c63760388ce6dac12361.tar
pbuilder-ad50ac00a531dbe60260c63760388ce6dac12361.tar.gz
import 0.125+nmu3
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 "$@"