r1985 - Try to fix IP address caching on --postnetdown

13 views
Skip to first unread message

com...@warewulf.lbl.gov

unread,
Apr 20, 2016, 2:10:54 PM4/20/16
to warewul...@lbl.gov
Author: gmk
Date: 2016-04-20 11:10:43 -0700 (Wed, 20 Apr 2016)
New Revision: 1985

Modified:
trunk/provision/initramfs/init
Log:
Try to fix IP address caching on --postnetdown


Modified: trunk/provision/initramfs/init
===================================================================
--- trunk/provision/initramfs/init 2016-04-15 01:07:05 UTC (rev 1984)
+++ trunk/provision/initramfs/init 2016-04-20 18:10:43 UTC (rev 1985)
@@ -342,11 +342,37 @@
fi
if [ -n "$WWPOSTNETDOWN" ]; then
NETDEV=`cat /tmp/wwdev`
- wwlogger "Shutting down network interface $NETDEV"
- msg_white "Shutting down network interface $NETDEV: "
- if ifconfig $NETDEV down; then
- wwsuccess
+ if [ -f "/tmp/ifcfg-$NETDEV" ]; then
+ . /tmp/ifcfg-$NETDEV
+ if [ -n "$IPADDR" -a -n "$NETMASK" ]; then
+ wwlogger "Deleting network interface address $NETDEV:$IPADDR/$NETMASK"
+ msg_white "Deleting network interface address $NETDEV:$IPADDR/$NETMASK"
+ if ifconfig $NETDEV del $IPADDR netmask $NETMASK; then
+ wwsuccess
+ else
+ wwfailure
+ fi
+ elif [ -n "$IPADDR" ]; then
+ wwlogger "Deleting network interface address $NETDEV:$IPADDR"
+ msg_white "Deleting network interface address $NETDEV:$IPADDR"
+ if ifconfig $NETDEV del $IPADDR; then
+ wwsuccess
+ else
+ wwfailure
+ fi
+
+ fi
+
+ wwlogger "Shutting down network interface $NETDEV"
+ msg_white "Shutting down network interface $NETDEV: "
+ if ifconfig $NETDEV down; then
+ wwsuccess
+ else
+ wwfailure
+ fi
else
+ wwfailure "Could not bring down $NETDEV"
+ msg_white "Could not bring down $NETDEV"
wwfailure
fi
fi

Reply all
Reply to author
Forward
0 new messages