Tille - I can see you, read those man pages!   Tille's Site

Example post-install cron script

Enter this script as a post-installation script in the /export/config/rules file for enabling use of apropos and man -k.

#!/sbin/sh
# This will make an index of man pages every night.
echo "2 2 * * * catman -w" >> /a/var/spool/cron/crontabs/root

Allow ssh by root

The default sshd_config file does not allow root logins. Using sed, this script changes the offending configuration directive:

#!/bin/bash
if [ -f /a/etc/ssh/sshd_config ]
then
        sed -e 's/^PermitRootLogin no/PermitRootLogin yes/' /a/etc/ssh/sshd_config > /tmp/sshtemp
        mv /tmp/sshtemp /a/etc/ssh/sshd_config
fi

Configuring Apache

Apache does not start if you don't give proof that you read the config file. At least you need to specify a hostname for your webserver. This is a way to do that:

#!/bin/bash
cp ${SI_CONFIG_DIR}/file_repository/httpd.conf /a/etc/apache
HOSTNAME=$(uname -n)
sed -e "s/armadillo/$HOSTNAME/" < /a/etc/apache/httpd.conf > /tmp/httpd.conf.new
cat /tmp/httpd.conf.new > /a/etc/apache/httpd.conf

Executing multiple scripts

If you need to do more than one post-installation configuration, have the rules file point to a script that will execute all scripts in a directory. This is an example:

#!/sbin/sh
for i in postinstall-scripts/*
  do
	sh $i
done
Home
© 1995-2010 Machtelt Garrels - tille - Powered by vIm - Best viewed with your eyes - Validated by W3C - Last update 20100511