diff --git a/compilators/debian/nginx/nginx-compile.sh b/compilators/debian/nginx/nginx-compile.sh index 7763453..ece7cb5 100644 --- a/compilators/debian/nginx/nginx-compile.sh +++ b/compilators/debian/nginx/nginx-compile.sh @@ -32,6 +32,8 @@ sudo mv $PACKAGE_MAIN_DIR/usr/local/alphax/nginx/sbin/nginx $PACKAGE_MAIN_DIR/us # Copy debian package META file sudo cp $MAIN_DIR/control $PACKAGE_MAIN_DIR/DEBIAN +sudo cp $MAIN_DIR/postinst $PACKAGE_MAIN_DIR/DEBIAN +sudo cp $MAIN_DIR/postrm $PACKAGE_MAIN_DIR/DEBIAN # Copy ALPHAX series files sudo cp $MAIN_DIR/alphax $PACKAGE_MAIN_DIR/etc/init.d/alphax diff --git a/compilators/debian/nginx/postinst b/compilators/debian/nginx/postinst new file mode 100644 index 0000000..7b35ddd --- /dev/null +++ b/compilators/debian/nginx/postinst @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +if [ "$1" != "configure" ]; then + exit 0 +fi + +# Touch and set permisions on default log files on installation +update-rc.d alphax defaults > /dev/null +invoke-rc.d alphax start || true diff --git a/compilators/debian/nginx/postrm b/compilators/debian/nginx/postrm new file mode 100644 index 0000000..d1fb519 --- /dev/null +++ b/compilators/debian/nginx/postrm @@ -0,0 +1,5 @@ +#!/bin/sh + +update-rc.d alphax remove > /dev/null 2>&1 + +exit 0