Prva inačica za buster
[vsftpd-cn.git] / debian / postinst
1 #!/bin/sh
2
3 set -e
4
5 [ "$1" = "configure" ] || exit 0
6 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
7
8 # Load CARNet functions
9 . /usr/share/carnet-tools/functions.sh
10
11 cp_check_and_sed '^#anonymous_enable=YES' \
12                  's/^#anonymous_enable=YES/anonymous_enable=NO/g' \
13                  /etc/vsftpd.conf && restart="yes" || true
14
15 cp_check_and_sed '^anonymous_enable=YES' \
16                  's/^anonymous_enable=YES/anonymous_enable=NO/g' \
17                  /etc/vsftpd.conf && restart="yes" || true
18
19 cp_check_and_sed '#local_enable=YES' \
20                  's/#local_enable=YES/local_enable=YES/g' \
21                  /etc/vsftpd.conf && restart="yes" || true
22
23 cp_check_and_sed '#write_enable=YES' \
24                  's/#write_enable=YES/write_enable=YES/g' \
25                  /etc/vsftpd.conf && restart="yes" || true
26
27 cp_check_and_sed '^#local_umask=' \
28                  's/#local_umask=.*$/local_umask=022/g' \
29                  /etc/vsftpd.conf && restart="yes" || true
30
31 # restart if needed
32 [ "$restart" = "yes" ] || exit 0
33 if [ -x /usr/sbin/invoke-rc.d ]; then
34   invoke-rc.d vsftpd restart
35 else
36   [ -x /etc/init.d/vsftpd ] && /etc/init.d/vsftpd restart
37 fi
38
39 #DEBHELPER#