| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
die() { |
| 4 |
echo >&2 E: "$2" returned error code "$1" |
| 5 |
echo >&2 N: Could not set up the loopback interface. |
| 6 |
exit 1 |
| 7 |
} |
| 8 |
|
| 9 |
if test -x /sbin/ifconfig; then |
| 10 |
/sbin/ifconfig lo up || die $? ifconfig |
| 11 |
elif test -x /sbin/ip; then |
| 12 |
/sbin/ip link set lo up || die $? ip |
| 13 |
elif test -x /bin/ip; then |
| 14 |
/bin/ip link set lo up || die $? ip |
| 15 |
else |
| 16 |
echo >&2 E: Neither ifconfig nor ip found. |
| 17 |
echo >&2 N: Could not set up the loopback interface. |
| 18 |
exit 1 |
| 19 |
fi |
| 20 |
|
| 21 |
# having this variable set could cause programs looking for unreachable machines |
| 22 |
unset http_proxy |
| 23 |
|
| 24 |
exec "$@" |