5 [ "$1" = "configure" ] || exit 0
6 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
8 # Load CARNet functions
9 . /usr/share/carnet-tools/functions.sh
11 if dpkg --compare-versions "$2" lt 2.0.5-2; then
13 cp_check_and_sed '^#anonymous_enable=YES' \
14 's/^#anonymous_enable=YES/anonymous_enable=NO/g' \
15 /etc/vsftpd.conf && restart="yes" || true
17 cp_check_and_sed '^anonymous_enable=YES' \
18 's/^anonymous_enable=YES/anonymous_enable=NO/g' \
19 /etc/vsftpd.conf && restart="yes" || true
21 cp_check_and_sed '#local_enable=YES' \
22 's/#local_enable=YES/local_enable=YES/g' \
23 /etc/vsftpd.conf && restart="yes" || true
25 cp_check_and_sed '#write_enable=YES' \
26 's/#write_enable=YES/write_enable=YES/g' \
27 /etc/vsftpd.conf && restart="yes" || true
29 cp_check_and_sed '^#local_umask=' \
30 's/#local_umask=.*$/local_umask=022/g' \
31 /etc/vsftpd.conf && restart="yes" || true
35 [ "$restart" = "yes" ] || exit 0
36 if [ -x /usr/sbin/invoke-rc.d ]; then
37 invoke-rc.d vsftpd restart
39 [ -x /etc/init.d/vsftpd ] && /etc/init.d/vsftpd restart