Add a force directive in log_badlogins. If uncommented it will force inserts even...
authorkkalev <kkalev>
Wed, 10 Mar 2004 14:29:32 +0000 (14:29 +0000)
committerkkalev <kkalev>
Wed, 10 Mar 2004 14:29:32 +0000 (14:29 +0000)
sql errors. That can help in case there is one sql query which stops the whole failed logins
logging system from working

dialup_admin/Changelog
dialup_admin/bin/log_badlogins

index 9479c2f..9f282a5 100644 (file)
@@ -9,6 +9,9 @@ Ver 1.68:
 * Add a patch from Neil McCalden to not put spaces in the -p argument to the mysql binary.
 * Fix a bug in conf/config.php3. Patch from Neil McCalden
 * In log_badlogins add a newline after every sql query so that the resulting file can be editable
+* Add a force directive in log_badlogins. If uncommented it will force inserts even if there are
+  sql errors. That can help in case there is one sql query which stops the whole failed logins
+  logging system from working
 Ver 1.65:
 * Add a captions.conf file with a few configurable captions for now
 * Move the nas list to a separate file called naslist.conf
index 648b085..5301e12 100755 (executable)
@@ -20,6 +20,11 @@ $file=shift||'none';
 $conf=shift||'/usr/local/dialup_admin/conf/admin.conf';
 $all_file=shift||'no';
 #
+# Uncomment to force inserts even if there are sql errors. That can
+# help in case there is one sql query which stops the whole failed
+# logins logging system from working
+#$force=1;
+#
 #
 # CHANGE THESE TO MATCH YOUR SETUP
 #
@@ -55,7 +60,9 @@ die "SQL server not defined\n" if ($sql_server eq '');
 die "sql_command directive is not set in admin.conf\n" if ($mysql eq '');
 die "Could not find mysql binary. Please make sure that the \$mysql variable points to the right location\n" if (! -x $mysql);
 
+$opt = "";
 $opt = "-O connect_timeout=$sql_timeout" if ($sql_timeout);
+$opt .= " -f" if ($force);
 @servers = (split /\s+/,$sql_extra) if ($sql_extra ne '');
 unshift @servers, $sql_server;