File: //var/lib/dpkg/info/ispmanager-pkg-phpext-ioncube.postinst
#!/bin/bash
# postinst script for coremanager
#
# see: dh_installdeb(1)
#set -e
# 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
MakeLink() {
[ ! -e ${1}/01-ioncube.ini ] && [ -d ${1} ] && [ ! -L ${1} ] && ln -s ${2} ${1}/01-ioncube.ini
}
COREDIR=/usr/local/mgr5
. ${COREDIR}/lib/pkgsh/ispmgr_pkg_funcs.sh
if [ "$(lsb_release -s -c)" = "focal" ] || [ "$(lsb_release -s -c)" = "bullseye" ] || [ -f /etc/apache2/mods-available/php7.4.load ] || [ -f /etc/php/7.4/fpm/php.ini ]; then
PHPETC=/etc/php/7.4
PHPMOD=php7.4
PHPLIB=/usr/lib/php
elif [ "$(lsb_release -s -c)" = "buster" ] || [ -f /etc/apache2/mods-available/php7.3.load ] || [ -f /etc/php/7.3/fpm/php.ini ]; then
PHPETC=/etc/php/7.3
PHPMOD=php7.3
PHPLIB=/usr/lib/php
elif [ "$(lsb_release -s -c)" = "bionic" ] || [ -f /etc/apache2/mods-available/php7.2.load ] || [ -f /etc/php/7.2/fpm/php.ini ]; then
PHPETC=/etc/php/7.2
PHPMOD=php7.2
PHPLIB=/usr/lib/php
elif [ "$(lsb_release -s -c)" = "xenial" ] || [ -f /etc/apache2/mods-available/php7.0.load ] || [ -f /etc/php/7.0/fpm/php.ini ]; then
PHPETC=/etc/php/7.0
PHPMOD=php7.0
PHPLIB=/usr/lib/php
elif [ "$(lsb_release -s -c)" = "jammy" ] || [ -f /etc/apache2/mods-available/php8.1.load ] || [ -f /etc/php/8.1/fpm/php.ini ]; then
PHPETC=/etc/php/8.1
PHPMOD=php8.1
PHPLIB=/usr/lib/php
elif [ "$(lsb_release -s -c)" = "bookworm" ] || [ -f /etc/apache2/mods-available/php8.2.load ] || [ -f /etc/php/8.2/fpm/php.ini ]; then
PHPETC=/etc/php/8.2
PHPMOD=php8.2
PHPLIB=/usr/lib/php
elif [ "$(lsb_release -s -c)" = "noble" ] || [ -f /etc/apache2/mods-available/php8.3.load ] || [ -f /etc/php/8.3/fpm/php.ini ]; then
PHPETC=/etc/php/8.3
PHPMOD=php8.3
PHPLIB=/usr/lib/php
else
PHPETC=/etc/php5
PHPMOD=php5
PHPLIB=/usr/lib/php5
fi
case "$1" in
configure)
if [ -z ${2} ]; then
PHP_VER=$(php -r "echo PHP_MAJOR_VERSION.\".\".PHP_MINOR_VERSION;")
SO_NAME="${PHPLIB}/ioncube/ioncube_loader_lin_${PHP_VER}.so"
echo "zend_extension = ${SO_NAME}" > ${PHPETC}/mods-available/ioncube.ini
MakeLink ${PHPETC}/conf.d ../mods-available/ioncube.ini
MakeLink ${PHPETC}/apache2/conf.d ../../mods-available/ioncube.ini
MakeLink ${PHPETC}/cgi/conf.d ../../mods-available/ioncube.ini
MakeLink ${PHPETC}/cli/conf.d ../../mods-available/ioncube.ini
MakeLink ${PHPETC}/fpm/conf.d ../../mods-available/ioncube.ini
ReloadWeb
# Afterinstall
AfterinstallModule ${ISPMGR} ioncube
fi
ReloadMgr ${ISPMGR}
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
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