Listing 3. Example Post-Install Script for Customization:postinstall
#!/bin/sh
# postinstall script for kickstart installation
# Installing remote shell execution permissions for
servers
cat <<EOF >/root/.rhosts
192.168.4.1 root
192.168.4.2 root
EOF
# Setting up DNS servers
cat <<EOF >/etc/resolv.conf
search UGL2.ee.uet.edu.pk
nameserver 192.168.4.1
nameserver 192.168.4.5
EOF
# Setting NIS domain name
cat <<EOF >>/etc/sysconfig/network
NISDOMAIN="UGL2.ee.uet.edu.pk"
EOF
# Setting automounter NIS maps by removing the /etc
files rm -f /etc/auto.master
rm -f /etc/auto.misc
# These lines allow network access to linuxconf
cat <<EOF >>/etc/conf.linuxconf
[netaccess]
htmlaccess.from 192.168.4.0 255.255.255.0
htmlaccess.dolog 0
htmlaccess.enable 1
EOF
# Miscellaneous initializations
cat <<EOF >>/etc/rc.d/rc.local
rdate -s time
EOF
# Changing runlevel to 5
./streplace /etc/inittab -x -w "r
now"="h now"
./streplace /etc/inittab -x -q
"id:3:initdefault:"="id:5:initdefault:"
# Getting rid of the lilo prompt
./streplace /etc/lilo.conf -x -w "prompt"="" "timeout\=50"=""
/sbin/lilo
# Configuring startup services and running
miscellaneous scripts
./config.pl
Copyright © 1994 - 2019 Linux Journal. All rights reserved.