HP Insight Control server provisioning Capturing and Installing Linux System Images
16
1. On the IC server provisioning appliance, create a new script of Unix type and name it for the appropriate
function.
2. Create the script content or copy and paste the script content from an external application. For example, the
SLES 11 SP3 script would contain:
#!/bin/bash
icspip="@@REPLACE_ME@@"
if [ "$icspip" == "@@REPLACE_ME@@" ]; then
# script is running on server as part of deployment
# need to set it up so that it runs after rebooting
# deployed server.
if [ -f "$0" ]; then
sed -i -e "s/=\"@@REPLACE_ME@@/=\"$1/" $0
# copy server into /rc{3,5}.d to run on startup.
cp $0 /mnt/target/etc/rc.d/rc3.d/S40hpsa_agent_installer
cp $0 /mnt/target/etc/rc.d/rc5.d/S40hpsa_agent_installer
rm -rf /mnt/target/etc/opt/opsware/agent/mid
rm -rf /mnt/target/var/opt/opsware/crypto/agent
cp -R /var/opt/opsware/crypto/agent \
/mnt/target/var/opt/opsware/crypto
cp /etc/opt/opsware/agent/mid \
/mnt/target/etc/opt/opsware/agent/mid
else
echo "Could not find script $0"
exit 1
fi
rm -rf /mnt/target/etc/rc*.d/*opsware*
echo "Done creating installation script for post reboot agent\
installation.."
exit 0
else
cp /etc/rc.d/rc3.d/S40hpsa_agent_installer /tmp
rm -rf /etc/rc.d/rc?.d/S40hpsa_agent_installer
fi
logfile=/tmp/Migrate.log
cd /tmp
filename=""
echo "**************************************************" >> $logfile
echo "******************** Start ***********************" >> $logfile
echo "**************************************************" >> $logfile
echo `date` >> $logfile
uname -a | grep 86_64
if [ $? -eq 1 ] ; then
echo "Cannot migrate x86 target" >> $logfile
exit "11"
fi
if [ -e /etc/redhat-release ] ; then
cat /etc/redhat-release | grep "6.*"
if [ $? -eq 0 ] ; then
echo "found RHEL6" >> $logfile
filename="opsware-agent-LINUX-6SERVER-X86_64"
fi
cat /etc/redhat-release | grep "5.*"
if [ $? -eq 0 ] ; then
echo "found RHEL5" >> $logfile