linux - How check FTP anonymous connection -


i want ask ftp connection in linux, how can check ftp anonymous connection in linux using terminal? use while loop read vsftpd.conf file, that

 while read line         if [ anonymous_enable=yes ];        echo " accept connection"     elif [ anonymous_enable=no ];       echo "not accept" fi done<vsftpd.conf 

not sure why using while loop can use simple bash script:

#!/bin/bash x=`cat /etc/vsftpd | grep ^anonymous_enable | awk -f= '{print $2}'` shopt -s nocasematch if [[ $x = "yes" ]]         echo -e "accept connection\n" else         echo -e "not accept\n" fi 

output:

[root@ftp ~]# sh /tmp/anon_check.sh accept connection