81e21611a5
Extended build of vsftpd with additional features. WWW: http://vsftpd.devnet.ru/eng/ PR: 193916 Submitted by: Xu Jing <xjflyttp@gmail.com>
36 lines
779 B
Bash
36 lines
779 B
Bash
#!/bin/sh
|
|
# $FreeBSD: /tmp/pcvs/ports/ftp/vsftpd-ext/pkg-install,v 1.1 2009-06-16 03:53:39 pgollucci Exp $
|
|
#
|
|
|
|
if [ "$2" != "PRE-INSTALL" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
if ! pw groupshow operator >/dev/null; then
|
|
if pw groupadd operator 5; then
|
|
echo "Added group operator for vsftpd"
|
|
else
|
|
echo "Failed to add group operator as gid 5" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if ! pw usershow ftp >/dev/null; then
|
|
if pw useradd ftp -g operator -u 14 -h - -d /var/ftp -s /nonexistent -c "Anonymous Ftp"; then
|
|
echo "Added user ftp for vsftpd"
|
|
else
|
|
echo "Failed to add user ftp as gid 14" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# uid=14(ftp) gid=5(operator) groups=5(operator)
|
|
view="$(id ftp)"
|
|
view="${view%% *}"
|
|
if test "${view}" = "uid=14(ftp)"; then
|
|
exit 0
|
|
fi
|
|
|
|
echo "User ftp should have uid 14"; >&2
|
|
exit 1
|
|
# eof
|