paul@0 | 1 | #!/bin/sh |
paul@0 | 2 | |
paul@0 | 3 | set -e |
paul@0 | 4 | |
paul@0 | 5 | #EXTRA# |
paul@0 | 6 | #DEBHELPER# |
paul@0 | 7 | |
paul@0 | 8 | if [ -d "/etc/php5/mods-available" ]; then |
paul@0 | 9 | inidir=/etc/php5/mods-available/ |
paul@0 | 10 | else |
paul@0 | 11 | inidir=/etc/php5/conf.d/ |
paul@0 | 12 | fi |
paul@0 | 13 | |
paul@0 | 14 | module=kolab |
paul@0 | 15 | package=php-${module} |
paul@0 | 16 | inifile=${module}.ini |
paul@0 | 17 | |
paul@0 | 18 | dpkg-maintscript-helper mv_conffile /etc/php5/conf.d/${inifile} ${inidir}/${inifile} 0.3.0~ -- "$@"; |
paul@0 | 19 | |
paul@0 | 20 | # Query which package has this conffile registered |
paul@0 | 21 | if which ucfq >/dev/null; then |
paul@0 | 22 | ucfp=$(ucfq -w ${inidir}/${inifile} | cut -f 2 -d:) |
paul@0 | 23 | fi |
paul@0 | 24 | |
paul@0 | 25 | # Only work with the config file if it still belongs to us |
paul@0 | 26 | if test "$ucfp" = ${package}; then |
paul@0 | 27 | if [ "$1" = "purge" ]; then |
paul@0 | 28 | for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do |
paul@0 | 29 | rm -f ${inidir}/${inifile}${ext} |
paul@0 | 30 | done |
paul@0 | 31 | |
paul@0 | 32 | rm -f ${inidir}/${inifile} |
paul@0 | 33 | |
paul@0 | 34 | if which ucf >/dev/null; then |
paul@0 | 35 | ucf --purge ${inidir}/${inifile} |
paul@0 | 36 | fi |
paul@0 | 37 | |
paul@0 | 38 | if which ucfr >/dev/null; then |
paul@0 | 39 | ucfr --purge ${package} ${inidir}/${inifile} |
paul@0 | 40 | fi |
paul@0 | 41 | fi |
paul@0 | 42 | fi |
paul@0 | 43 | |
paul@0 | 44 | exit 0 |