xcat-core/xCAT/postscripts/xcatinstallpost
ericagar 29cc018a5b For Ubuntu, mypostscript.post will not survive across a reboot, because Ubuntu clears out /tmp on reboot.
Keep mypostscript.post in /var/tmp across the reboot for Ubuntu.


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10299 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2011-08-17 02:40:40 +00:00

51 lines
1.6 KiB
Bash
Executable File

#!/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.
#################################################################
if [ ! `uname` == Linux ]; then
MYDIR=`dirname $0`
#exec $MYDIR/xcatdsklspost.aix
logger -t xcat "$0: the OS name is not Linux"
exit
fi
let SLI=$RANDOM%10
sleep $SLI
cd /xcatpost;
PATH=/xcatpost:$PATH
export PATH
chmod +x /xcatpost/*;
# 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
if [ -x /usr/bin/openssl ]; then
SIP=`grep "^MASTER=" ${POST_IN_DIR}/mypostscript.post |cut -d= -f2`
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
# Regardless of where mypostscript.post was found, modify and run it in /tmp.
DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' ${POST_IN_DIR}/mypostscript.post`
echo "$DHCP_TMP" > /tmp/mypostscript.post
echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /tmp/mypostscript.post
chmod +x /tmp/mypostscript.post
if [ -x /tmp/mypostscript.post ];then
/tmp/mypostscript.post
fi