#!/bin/bash

. ${TOOLKIT}-functions.sh

# local machine customization dir, basic files
#
kusalocal="/etc/kusa/modules/local"

file="$kusalocal/install"
[ -f $file ] || {
	:> $file
	putwarning "$file (file)" \
		"a new 'install' file has been created"
}
file="$kusalocal/relcompat"
[ -f $file ] || {
	echo '*' >$file
}

file="$kusalocal/run-install"
[ -f $file ] || {
	(
	  echo "#!/bin/bash"
	  echo "#"
	  echo "# customize this file for you needs"
	  echo "#"
	  echo ". \${TOOLKIT}-functions.sh"
	  echo ""
	  echo "# .. (insert your code here) .."
	  echo ""
	  echo "\$SOMETHING_CHANGED && {"
	  echo "	# uncomment relevant commands"
	  echo "	:"
	  echo ""
	  echo "	# === srv-mail modules changes"
	  echo "	#(cd /etc/postfix ; make)"
	  echo ""
	  echo "	# === srv-mail content filter modules changes"
	  echo "	#echo -n 'checking spamassassin ... '"
	  echo "	#spamassassin --lint"
	  echo "	#echo 'ok'"
	  echo "	#restart_service amavis"
	  echo ""
	  echo "	# === srv-web modules changes"
	  echo "	#reload_service apache2 apache2"
	  echo "}"
	  echo ""
	  echo "exit 0"
	) >$file
	chown root:root $file
	chmod 770 $file
	putwarning "$file (file)" \
		"a new default run-install file was created in you local" \
		"kusa module directory, customize it for your needs"
}

exit 0
