2009-12-15 14:25:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
#################################################################
|
|
|
|
#
|
|
|
|
# xCAT script for running postboot scripts for full install case.
|
|
|
|
#################################################################
|
|
|
|
|
2011-08-17 23:01:29 +00:00
|
|
|
if [ ! `uname` = Linux ]; then
|
2009-12-15 14:25:36 +00:00
|
|
|
MYDIR=`dirname $0`
|
|
|
|
#exec $MYDIR/xcatdsklspost.aix
|
2010-04-06 08:17:04 +00:00
|
|
|
logger -t xcat "$0: the OS name is not Linux"
|
2009-12-15 14:25:36 +00:00
|
|
|
exit
|
|
|
|
fi
|
2011-08-17 23:01:29 +00:00
|
|
|
SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}')
|
2009-12-15 14:25:36 +00:00
|
|
|
sleep $SLI
|
|
|
|
|
|
|
|
cd /xcatpost;
|
|
|
|
PATH=/xcatpost:$PATH
|
|
|
|
export PATH
|
|
|
|
chmod +x /xcatpost/*;
|
|
|
|
|
2011-08-17 02:40:40 +00:00
|
|
|
# Traditionally, mypostscript.post has been kept in /tmp across the first boot.
|
|
|
|
# However, Ubuntu cleans /tmp on reboot. So, for Ubuntu, /var/tmp is used instead.
|
|
|
|
# Therefore, allow for finding mypostscript.post in /var/tmp or /tmp.
|
|
|
|
|
|
|
|
if [ -e /var/tmp/mypostscript.post ]; then
|
|
|
|
POST_IN_DIR="/var/tmp"
|
|
|
|
else
|
|
|
|
POST_IN_DIR="/tmp"
|
|
|
|
fi
|
|
|
|
|
2010-03-17 14:37:20 +00:00
|
|
|
if [ -x /usr/bin/openssl ]; then
|
2011-08-17 02:40:40 +00:00
|
|
|
SIP=`grep "^MASTER=" ${POST_IN_DIR}/mypostscript.post |cut -d= -f2`
|
2010-03-17 14:37:20 +00:00
|
|
|
XCATSERVER="$SIP:3001"
|
|
|
|
export XCATSERVER
|
|
|
|
USEOPENSSLFORXCAT=1 #Though this is the only method going forward, flag to allow backward compatibility with 2.2 generated netboot images
|
|
|
|
export USEOPENSSLFORXCAT
|
|
|
|
fi
|
2009-12-15 14:25:36 +00:00
|
|
|
|
2011-08-17 02:40:40 +00:00
|
|
|
# Regardless of where mypostscript.post was found, modify and run it in /tmp.
|
2009-12-15 14:25:36 +00:00
|
|
|
|
2011-08-17 02:40:40 +00:00
|
|
|
DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' ${POST_IN_DIR}/mypostscript.post`
|
|
|
|
echo "$DHCP_TMP" > /tmp/mypostscript.post
|
2009-12-15 14:25:36 +00:00
|
|
|
|
2011-08-17 02:40:40 +00:00
|
|
|
echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /tmp/mypostscript.post
|
2009-12-15 14:25:36 +00:00
|
|
|
|
2011-08-17 02:40:40 +00:00
|
|
|
chmod +x /tmp/mypostscript.post
|
|
|
|
if [ -x /tmp/mypostscript.post ];then
|
|
|
|
/tmp/mypostscript.post
|
2011-08-13 17:54:25 +00:00
|
|
|
fi
|