Your IP : 18.118.24.176


Current Path : /var/lib/dpkg/info/
Upload File :
Current File : /var/lib/dpkg/info/isp-php71.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

PHP_VER=71
PHP_PREFIX=/opt/php${PHP_VER}
PHP_INI=${PHP_PREFIX}/etc/php.ini

case "$1" in
    configure)
		if [ -z ${2} ]; then
			TZ=$(cat /etc/timezone)
			if grep -qE "^date.timezone\s*=" ${PHP_INI} ; then
				sed -i -r "s|^date.timezone\s*=.*|date.timezone = ${TZ}|" ${PHP_INI}
			else
				echo "date.timezone = ${TZ}" >> ${PHP_INI}
			fi
			for ext in dom gd mbstring mysqlnd mysqli pdo pdo_mysql json curl mcrypt soap xmlrpc zendopcache intl xmlreader xmlwriter zip phar sodium ; do
				case ${ext} in
					mysqlnd|pdo)
						extl=10-${ext}
					;;
					*)
						extl=20-${ext}
					;;
				esac
				ln -sf ../mods-available/${ext}.ini ${PHP_PREFIX}/etc/php.d/${extl}.ini ;
			done
		else
			if [ -f ${PHP_PREFIX}/etc/php.d/zenddopcache.ini ]; then
				rm -f ${PHP_PREFIX}/etc/php.d/zenddopcache.ini
				ln -sf ../mods-availablezendopcache.ini ${PHP_PREFIX}/etc/php.d/10-zendopcache.ini
			fi
			if [ -f ${PHP_PREFIX}/etc/php.d/mysqli.ini ]; then
				if [ ! -f ${PHP_PREFIX}/etc/php.d/10-mysqlnd.ini ] && [ ! -f ${PHP_PREFIX}/etc/php.d/mysqlnd.ini ]; then
					ln -s ../mods-available/mysqlnd.ini ${PHP_PREFIX}/etc/php.d/10-mysqlnd.ini
				fi
			fi
			for ext in phar ; do
				extl=20-${ext}
				if [ -f /tmp/.list_modules_php${PHP_VER}.tmp ] && [ -f ${PHP_PREFIX}/lib/php/modules/${ext}.so ] ; then
					ln -sf ../mods-available/${ext}.ini  ${PHP_PREFIX}/etc/php.d/${extl}.ini
					rm -f /tmp/.list_modules_php${PHP_VER}.tmp
				fi
			done
		fi
    ;;

    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