Logging for FTp Daemon
Hi all,
I tried using the following command on a red hat system: FILE="" if [ -f /etc/vsftpd.conf ]; then FILE="/etc/vsftpd.conf" else FILE="/etc/vsftpd/vsftpd.conf" fi if [ -f $FILE ]; then awk '/^#?xferlog_std_format/ \ { print "xferlog_std_format=NO"; next }; /^#?log_ftp_protocol/ \ { print "log_ftp_protocol=YES"; next }; { print }' ${FILE}-preCIS > ${FILE} if [ `egrep -c log_ftp_protocol ${FILE}` == 0 ]; then echo "log_ftp_protocol=YES" >> ${FILE} fi chown root:root $FILE chmod 0600 $FILE echo "diff ${FILE}-preCIS $FILE" diff ${FILE}-preCIS $FILE else echo "OK - No /etc/vsftpd.conf." fi However, the system return me an error saying, "syntax error near unexpected token `fi'. I suppose the it is trying to say that there are some errors near the last "fi". Any ideas? Thanks. |
It looks like the problem is a missing \. Please put long code segments in tags in the future, but I think this is what you wanted:
Code:
FILE="" Alunduil |
I tried inserting the "\", but the problem is still there.
Regards JS |
Well, usually it also gives the linenum when that happens. Can you show the exact & entire err msg.
One option for you to try is to put set -xv as the 2nd line of your script ie just after the #!/usr/bin/bash type line. The set cmd will show you exactly what's happening. |
Just a note, but you can actually just change the shebang line to read: #!/bin/bash -xv as well.
Regards, Alunduil |
Thanks all.
|
All times are GMT -5. The time now is 08:06 PM. |