From 27e9a6a3c080a1aebe30eea31f87013a5b3d5ee8 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 14 Jul 2011 17:03:00 +0000 Subject: [PATCH] Add dhclient-script from nbroot2 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10087 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot2/dhclient-script | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 xCAT-nbroot2/dhclient-script diff --git a/xCAT-nbroot2/dhclient-script b/xCAT-nbroot2/dhclient-script new file mode 100755 index 000000000..e947f474b --- /dev/null +++ b/xCAT-nbroot2/dhclient-script @@ -0,0 +1,31 @@ +#!/bin/dash +if [ $reason = "PREINIT" -o $reason = "PREINIT6" ]; then + ip link set $interface up + while ! (ip link show $interface|grep LOWER_UP > /dev/null 2>&1); do + sleep 0.1 + done +elif [ $reason = "BOUND" ]; then + if [ ! -z "$new_ip_address" -a ! -z "$new_subnet_mask" ]; then + ip addr add dev $interface $new_ip_address/$new_subnet_mask + fi + if [ ! -z "$new_host_name" ]; then + hostname $new_host_name + lldptool -T -i $interface -V 5 enableTx=yes + fi + if [ ! -z "$new_domain_name" ]; then + echo search $new_domain_name >> /etc/resolv.conf + fi + for ns in $new_domain_servers; do + echo nameserver $ns >> /etc/resolv.conf + done + for ntp in $new_ntp_servers; do + echo server $ntp >> /etc/ntp.conf + done + for gw in $new_routers; do + ip route add default via $gw + done +elif [ $reason = "BOUND6" ]; then + if [ ! -z "$new_ip6_address" ]; then + ip addr add dev $interface $new_ip6_address/$new_ip6_prefixlen + fi +fi