OK, maybe it will help someone…
I have a script set to run on the first boot of the system in autoyast,
using this xml…
And this is an extract from the shell script
#we need to edit the hosts file as autoyast won’t do it
#we need to extract hostname from /etc/hosts as the hostname
#enviroment variable seems only to contain LINUX on first boot, not the
server name
#hostnames with spaces will break this
#and serve the perpetrator right
realhostname=$(cat /etc/HOSTNAME | cut -d\. -f1)
realfqdn=$(cat /etc/HOSTNAME)
sed -i ‘s/’$realfqdn’/’$realfqdn’ ‘$realhostname’/g’ /etc/hosts
The firstboot script, combined with the use is proving to be a useful
tool for the way I want to work. What I’m tending to do is set up a
subdir on the smt server for each app I want in post install, together
with a shell script. In the main script I wget the shell script and run
it. For instance the wy I’m installing the Tivoli backup software we use
is with this shell script
#!/bin/bash
cd /tmp
echo “Dowloading installation rpms from susedisto server.”
wget http://[smthost]/repo/tivoli/TIVsm-BA.i386.rpm
wget http://[smthost]/repo/tivoli/TIVsm-API64.i386.rpm
wget http://[smthost]/repo/tivoli/TIVsm-API.i386.rpm
wget http://[smthost]/gskssl32-8.0.14.6.linux.x86.rpm
wget http://[smthost]/repo/tivoli/gskcrypt32-8.0.14.6.linux.x86.rpm
wget http://[smthost]/repo/tivoli/gskssl64-8.0.14.6.linux.x86_64.rpm
wget http://[smthost]/repo/tivoli/gskcrypt64-8.0.14.6.linux.x86_64.rpm
echo “Downloading shell scripts and config files.”
wget http://[smthost]/repo/tivoli/dsmcsched.sh
wget http://[smthost]/repo/tivoli/dsmcadsched.sh
wget http://[smthost]/repo/tivoli/dsmcrestart.sh
wget http://[smthost]/repo/tivoli/notification.msg
wget http://[smthost]/repo/tivoli/dsm.opt
wget http://[smthost]/repo/tivoli/dsm.sys
chmod 700 *.sh
echo “Installing tivoli rpms.”
rpm -U /tmp/gskssl32-8.0.14.6.linux.x86.rpm
/tmp/gskcrypt32-8.0.14.6.linux.x86.rpm
rpm -U /tmp/gskssl64-8.0.14.6.linux.x86_64.rpm
/tmp/gskcrypt64-8.0.14.6.linux.x86_64.rpm
rpm -U /tmp/TIVsm-API.i386.rpm /tmp/TIVsm-API64.i386.rpm
/tmp/TIVsm-BA.i386.rpm
REALHOSTNAME=$(cat /etc/HOSTNAME | cut -d\. -f1)
echo “Creating new dsm.sys with node name $REALHOSTNAME from master
copy.”;
cp /tmp/dsm.sys /opt/tivoli/tsm/client/ba/bin/dsm.sys;
echo "nodename " $REALHOSTNAME >>
/opt/tivoli/tsm/client/ba/bin/dsm.sys;
echo “Copying scheduling scripts to /etc/init.d and setting them up as
services.”
cp /tmp/dsmcsched.sh /etc/init.d/dsmc
cp /tmp/dsmcadsched.sh /etc/init.d/dsmcad
cp /tmp/dsm.opt /opt/tivoli/tsm/client/ba/bin/dsm.opt
cd /etc/init.d
insserv dsmc
insserv dsmcad
#and now the notification email to the backup admins to set up the
server
#the notification.msg contains text placeholder whereever I want the
server name to appear.
PLACEHOLDER=“placeholder”
sed -i ‘s/’$PLACEHOLDER’/’$REALHOSTNAME’/g’ /tmp/notification.msg
sendmail of admins </tmp/notification.msg
echo “”
Now I’m not presenting this as any great model for the best way to do
these things. I’m very much a novice at shell scripts, autoyast and
all the rest of it (but learning fast I hope), and I am very sure
this can be done much better. However it seems to be working for me
and making my life easier. So its presented here simply for
inspiration.
–
jimc
jimc’s Profile: http://forums.novell.com/member.php?userid=6130
View this thread: http://forums.novell.com/showthread.php?t=451394