File: postinst

package info (click to toggle)
proftpd 1.2.0pre1-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,468 kB
  • ctags: 2,106
  • sloc: ansic: 19,206; sh: 1,640; makefile: 480; perl: 235
file content (27 lines) | stat: -rw-r--r-- 780 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash -e
if [ "$1" = "configure" -a "$2" = "" ]; then
    if egrep "^## " /etc/proftpd.conf > /dev/null
    then
	echo -n "Enable anonymous ftp access [y/N]? "
	read X
	if [ "$X" = "Y" -o "$X" = "y" ]; then
		echo "Editing /etc/proftpd.conf ... "
 		if ! grep -q "^ftp:" /etc/passwd; then
			echo "Addiing ftp user to the system ... "
			adduser --system ftp
			cp -i -p -v /usr/doc/proftpd/examples/welcome.msg \
			    ~ftp/welcome.msg || true
		fi
		sed "s/^## //" /etc/proftpd.conf > /etc/proftpd.conf.dpkg-tmp
		mv /etc/proftpd.conf.dpkg-tmp /etc/proftpd.conf
	fi
    fi
fi

if [ "$1" = "configure" ]; then
    # Automatically inserted by debstd on Fri, 17 Apr 1998 18:55:22 -0400
    update-rc.d proftpd defaults 50 >/dev/null
    /etc/init.d/proftpd start
fi

exit 0