1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Constants definition logic modification

Correction avoiding script exit when configuration file doesn't exist because MySQL connection constants can also be set at the beginning of this script.
This commit is contained in:
Deltawings
2021-11-10 22:25:51 +01:00
committed by GitHub
parent e20c1cf269
commit d3a8aaef51

View File

@@ -27,9 +27,9 @@ if (!array_key_exists('SCRIPT_FILENAME', $_SERVER)
# ============================================================================ # ============================================================================
# CONFIGURATION # CONFIGURATION
# ============================================================================ # ============================================================================
# Define MySQL connection constants in config.php. Instead of defining # Define MySQL connection constants. Instead of defining parameters here,
# parameters here, you can define them in another file named the same as this # you can also define them in another file named the same as this
# file, with a .cnf extension. # file with a .cnf extension.
# ============================================================================ # ============================================================================
$mysql_user = ''; $mysql_user = '';
@@ -77,9 +77,6 @@ echo("<<<mysql>>>\n");
if (file_exists(__FILE__ . '.cnf' ) ) { if (file_exists(__FILE__ . '.cnf' ) ) {
require(__FILE__ . '.cnf'); require(__FILE__ . '.cnf');
debug('Found configuration file ' . __FILE__ . '.cnf'); debug('Found configuration file ' . __FILE__ . '.cnf');
} else {
echo("No ".__FILE__ . ".cnf found!\n");
exit();
} }
# Make this a happy little script even when there are errors. # Make this a happy little script even when there are errors.