]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
NextStep client script
authorTed Lemon <source@isc.org>
Wed, 17 Sep 1997 00:23:46 +0000 (00:23 +0000)
committerTed Lemon <source@isc.org>
Wed, 17 Sep 1997 00:23:46 +0000 (00:23 +0000)
client/scripts/nextstep [new file with mode: 0644]

diff --git a/client/scripts/nextstep b/client/scripts/nextstep
new file mode 100644 (file)
index 0000000..15623a3
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# simplified dhclient-script for NeXTSTEP/OPENSTEP
+#
+# removed a lot of the cruft from the netbsd version since NeXTSTEP doesn't
+# support aliases and lots of things were breaking for no good reason
+#
+# 14 Sep 1997, David W. Young
+#
+if [ x$reason = xPREINIT ]; then
+  ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 up >/dev/null 2>&1
+  exit 0
+fi
+if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
+   [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
+  if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+    ifconfig $interface $new_ip_address netmask $new_subnet_mask >/dev/null 2>&1
+    route add $new_ip_address 127.1 0 >/dev/null 2>&1
+    for router in $new_routers ; do
+      route add default $router 1 >/dev/null 2>&1
+    done
+  fi
+  echo search $new_domain_name >/etc/resolv.conf
+  for nameserver in $new_domain_name_servers; do
+    echo nameserver $nameserver >>/etc/resolv.conf
+  done
+  exit 0
+fi
+if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
+  if [ x$old_ip_address != x ]; then
+    route delete $old_ip_address 127.1 >/dev/null 2>&1
+    for $router in $old_routers ; do
+      route delete default $router >/dev/null 2>&1
+    done
+  fi
+  exit 0
+fi