#!/usr/bin/env php . * * @package LibreNMS * @link http://librenms.org * @copyright 2017 Tony Murray * @author Tony Murray */ use LibreNMS\Exceptions\DatabaseConnectException; if (!isset($init_modules)) { $init_modules = array('nodb'); require __DIR__ . '/includes/init.php'; $opts = getopt('ldh:u:p:n:t:s:'); try { if (isset($opts['h'])) { dbConnect( isset($opts['h']) ? $opts['h'] : null, isset($opts['u']) ? $opts['u'] : '', isset($opts['p']) ? $opts['p'] : '', isset($opts['n']) ? $opts['n'] : '', isset($opts['t']) ? $opts['t'] : null, isset($opts['s']) ? $opts['s'] : null ); } else { // use configured database credentials dbConnect(); } } catch (DatabaseConnectException $e) { echo $e->getMessage() . PHP_EOL; exit; } $debug = isset($opts['d']); $skip_schema_lock = isset($opts['l']); } require __DIR__ . '/includes/sql-schema/update.php'; exit($return);