Prva inačica za buster
[php-apc-cn.git] / debian / postinst
1 #!/bin/sh
2 # postinst script for proftpd-cn
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # summary of how this script can be called:
9 #        * <postinst> `configure' <most-recently-configured-version>
10 #        * <old-postinst> `abort-upgrade' <new version>
11 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12 #          <new-version>
13 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
14 #          <failed-install-package> <version> `removing'
15 #          <conflicting-package> <version>
16 # for details, see http://www.debian.org/doc/debian-policy/ or
17 # the debian-policy package
18 #
19
20 case "$1" in
21     configure|reconfigure)
22       # continue below
23     ;;
24
25     *)
26         exit 0
27     ;;
28 esac
29
30 # Import CN toolsa
31 . /usr/share/carnet-tools/functions.sh
32
33 CONF=/etc/php5/mods-available/apc.ini
34
35 if [ -e "$CONF" ]; then
36     echo "CN: Enabling CARNet APC modifications"
37     cp -a "$CONF" "$CONF.$$"
38     cp-update --comment ';' php-apc-cn "$CONF.$$" <<EOF
39 apc.enabled=1
40 apc.shm_size=64M
41 apc.include_once_override=0
42 apc.shm_segments=1
43 apc.ttl=7200
44 apc.user_ttl=7200
45 apc.num_files_hint=1024
46 apc.mmap_file_mask=/tmp/apc.XXXXXX
47 apc.enable_cli=1
48 apc.max_file_size=10M
49 EOF
50     cp_mv "$CONF.$$" "$CONF"
51 else
52         echo "CN: $CONF not found, not enabling CARNet APC modifications"
53 fi
54
55 # reload Apache
56 if apache2ctl configtest 2>/dev/null; then
57     echo "CN: Reloading Apache..."
58     invoke-rc.d apache2 force-reload || true
59 else
60     echo "CN: Your Apache2 configuration is either broken or nonexistant"
61 fi
62
63 # dh_installdeb will replace this with shell code automatically
64 # generated by other debhelper scripts.
65
66 #DEBHELPER#
67
68 exit 0