summaryrefslogtreecommitdiffstats
path: root/contrib/bochs/ifup.tun
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bochs/ifup.tun')
-rwxr-xr-xcontrib/bochs/ifup.tun21
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/bochs/ifup.tun b/contrib/bochs/ifup.tun
new file mode 100755
index 00000000..8e2ede20
--- /dev/null
+++ b/contrib/bochs/ifup.tun
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+SCRIPT=$0
+INTERFACE=$1
+
+if [ `id -u` != 0 ]; then
+ echo ""
+ echo "Enter root password for configuring network interface $INTERFACE"
+ echo "(To avoid this prompt, make the script $SCRIPT setuid-root)"
+ /bin/su -c "$SCRIPT $INTERFACE" || exit 1
+ exit 0
+fi
+
+/sbin/ifconfig $INTERFACE 10.254.254.2 netmask 255.255.255.252
+
+# Force dhcpd to notice the new network interface
+if [ -x /etc/init.d/dhcpd ]; then
+ /etc/init.d/dhcpd reload # Redhat
+elif [ -x /etc/init.d/dhcp ]; then
+ /etc/init.d/dhcp restart # Debian
+fi