Explorar el Código

check vsftpd.conf in common locations

Serghey Rodin hace 13 años
padre
commit
b072479b53
Se han modificado 1 ficheros con 12 adiciones y 2 borrados
  1. 12 2
      bin/v-change-sys-ip-nat

+ 12 - 2
bin/v-change-sys-ip-nat

@@ -43,9 +43,19 @@ else
     update_ip_value '$NAT' "$nat_ip"
 fi
 
-# Change vsftpd config
+# Check ftp system
 if [ "$FTP_SYSTEM" = 'vsftpd' ]; then
-    conf="/etc/vsftpd/vsftpd.conf"
+
+    # Find configuration
+    if [ -e '/etc/vsftpd/vsftpd.conf' ]; then
+        conf='/etc/vsftpd/vsftpd.conf'
+    fi
+
+    if [ -e '/etc/vsftpd.conf' ]; then
+        conf='/etc/vsftpd.conf'
+    fi
+
+    # Update config
     if [ -z "$(grep pasv_address $conf)" ]; then
         if [ ! -z "$nat_ip" ]; then
             echo "pasv_address=$nat_ip" >> $conf