#!/bin/bash
#
# post install fixes (release independent)

. ${TOOLKIT}-functions.sh

set -e	# exit on errors


#---------------------------------------------------------------------
# boot logging enanched
#---------------------------------------------------------------------
#
target="/etc/lsb-base-logging.sh"
file=$(filepath lsb-base-logging.sh) && {
	installfile $file $target root:root 644
}

target="/lib/lsb/init-functions.d/"
file=$(filepath 30-ku-logging) && {
	installfile $file $target root:root 644
}


# if-up/if-down procedures (see desc.txt)
#
for script in ntpdate mountnfs
do
	for dir in if-down.d if-post-down.d if-pre-up.d if-up.d
	do
		file="/etc/network/$dir/$script"
		[ -f $file ] && {
			echo "  removing $file"
			rm -f $file
		}
	done
done


# relocate /var/spool/cron to etc (because this contains CONFIG DATAS,
# a spool directory is not the right place)
#
[ ! -L /var/spool/cron -a ! -d /etc/cron-spool ] && {
	echo "  relocating /var/spool/cron -> /etc/cron-spool"
	mv /var/spool/cron /etc/cron-spool			|| exit $?
	(cd /var/spool ; ln -s ../../etc/cron-spool cron)	|| exit $?
}

exit 0
