From a39ac09f3afac5474d18f1d84ab62eb788eb8d65 Mon Sep 17 00:00:00 2001 From: Camille Lafitte Date: Thu, 4 Jul 2024 11:33:07 +0200 Subject: [PATCH] Update AlternC database schema * Inject in AlternC database table required to manage httpperm behavior --- debian/postinst | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index 68c50de..f507ec9 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,7 +1,19 @@ #!/bin/bash -e +ALTERNC_FUNCTIONS_FILE="/usr/lib/alternc/functions.sh" +HTTPPERM_SQL_FILE="/usr/share/alternc/install/httpperm.sql" + +if [ ! -r "${ALTERNC_FUNCTIONS_FILE}" ]; then + echo "Can't access ${ALTERNC_FUNCTIONS_FILE}" + exit 1 +fi + +# shellcheck source=/dev/null +. "${ALTERNC_FUNCTIONS_FILE}" + case "$1" in configure) + mysql_query "$(cat ${HTTPPERM_SQL_FILE})" printf "\tDon't forget to apply httpperm iptables rules as explained on Readme\n" ;; @@ -11,5 +23,4 @@ esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. -#DEBHELPER# - +#DEBHELPER# \ No newline at end of file