diff options
author | freaj <freaj@riseup.net> | 2015-03-30 10:36:00 +0200 |
---|---|---|
committer | freaj <freaj@riseup.net> | 2015-03-30 10:36:00 +0200 |
commit | 7385c6143c1b587bca68deade6e5989d11879767 (patch) | |
tree | 6ccef2617293e9afd03c80d5de22fd8f9c260c70 /pcr/openrc-net/vsftpd-checkconfig.sh | |
parent | 41c9dc8729840f45f174a14a08703e04d1f5717e (diff) | |
download | abslibre-7385c6143c1b587bca68deade6e5989d11879767.tar.gz abslibre-7385c6143c1b587bca68deade6e5989d11879767.tar.bz2 abslibre-7385c6143c1b587bca68deade6e5989d11879767.zip |
openrc-net-20150330-1: updating version
Diffstat (limited to 'pcr/openrc-net/vsftpd-checkconfig.sh')
-rw-r--r-- | pcr/openrc-net/vsftpd-checkconfig.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pcr/openrc-net/vsftpd-checkconfig.sh b/pcr/openrc-net/vsftpd-checkconfig.sh new file mode 100644 index 000000000..e1d1e5231 --- /dev/null +++ b/pcr/openrc-net/vsftpd-checkconfig.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +VSFTPD_CONF="${VSFTPD_CONF:-/etc/vsftpd/vsftpd.conf}" + +if [ ! -e ${VSFTPD_CONF} ] ; then + echo "Please setup ${VSFTPD_CONF} before starting vsftpd" >&2 + echo "There are sample configurations in /usr/share/doc/vsftpd" >&2 + exit 1 +fi + +if egrep -iq "^ *background *= *yes" "${VSFTPD_CONF}" ; then + echo "${VSFTPD_CONF} must not set background=YES" >&2 + exit 1 +fi + +has_ip=false has_ipv6=false ip_error=true +egrep -iq "^ *listen *= *yes" "${VSFTPD_CONF}" && has_ip=true +egrep -iq "^ *listen_ipv6 *= *yes" "${VSFTPD_CONF}" && has_ipv6=true +if ${has_ip} && ! ${has_ipv6} ; then + ip_error=false +elif ! ${has_ip} && ${has_ipv6} ; then + ip_error=false +fi +if ${ip_error} ; then + echo "${VSFTPD_CONF} must contain listen=YES or listen_ipv6=YES" >&2 + echo "but not both" >&2 + exit 1 +fi + |