File: //var/lib/dpkg/info/ctrlsh-unix-webserver.postinst
#!/bin/sh
# vim: ts=4 sts=4 sw=4 et ai
# postinst script for ctrlsh-core
#
# see: dh_installdeb(1)
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
set -e
case "$1" in
configure|abort-upgrade|abort-remove|abort-deconfigure)
httpd_header_conf_path="/opt/ctrlsh/etc/apache/httpd-header.conf";
if [ ! -f $httpd_header_conf_path ]; then
echo "Include httpd-header.conf" > $httpd_header_conf_path;
fi
for extra_file in /opt/ctrlsh/etc/apache/httpd-footer.conf \
/opt/ctrlsh/etc/apache/httpd-stub.conf \
/etc/network/dedicated-ip; do
[ ! -f $extra_file ] && touch $extra_file;
done
chown root:ctrlsh -R /opt/ctrlsh/etc/templates /opt/ctrlsh/etc/apache
chmod 0555 /opt/ctrlsh/etc/templates /opt/ctrlsh/etc/templates/nginx
find /opt/ctrlsh/etc/templates -type f -exec chmod 0444 {} \;
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0