because of a syntax error in /etc/init/vsftpd.con, vsftd is started (and respawns a lot as it fails to start) if there's no "listen=yes" in /etc/vsftpd.conf
without space between ! and egrep. As a result !egrep returns with an error ("!egrep" command not found) and as a result, the script assumes the "listen = yes" line is in the file.
Moreover, if the /etc/vsftpd.conf file is not there, vsftpd is also started which I suspect was not intended.
Moreover egrep is not a POSIX command.
Would be better written as:
if ! grep -qEis -- '^[[:blank:]]*listen(_ipv6)?[[:blank:]]*=[[:blank:]]*yes' "$CONFFILE"; then...
Binary package hint: vsftpd
(lucid vsftpd 2.2.2-3ubuntu6)
because of a syntax error in /etc/init/ vsftpd. con, vsftd is started (and respawns a lot as it fails to start) if there's no "listen=yes" in /etc/vsftpd.conf
/etc/init/ vsftpd. conf has:
if [ -e "${CONFFILE}" ] && !egrep -iq "^ *listen(_ipv6)? *= *yes" "${CONFFILE}"
without space between ! and egrep. As a result !egrep returns with an error ("!egrep" command not found) and as a result, the script assumes the "listen = yes" line is in the file.
Moreover, if the /etc/vsftpd.conf file is not there, vsftpd is also started which I suspect was not intended.
Moreover egrep is not a POSIX command.
Would be better written as:
if ! grep -qEis -- '^[[:blank: ]]*listen( _ipv6)? [[:blank: ]]*=[[: blank:] ]*yes' "$CONFFILE"; then...