librenms/config_to_json.php

18 lines
419 B
PHP
Raw Normal View History

#!/usr/bin/env php
2013-11-03 23:03:57 +00:00
<?php
/*
* Configuration to JSON converter
* Written by Job Snijders <job@instituut.net>
*
*/
2013-11-03 23:03:57 +00:00
chdir(__DIR__); // cwd to the directory containing this script
2013-11-03 23:03:57 +00:00
2015-08-13 10:28:06 +00:00
// check if we are running through the CLI, otherwise abort
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
include_once 'includes/defaults.inc.php';
include_once 'config.php';
echo json_encode($config);
2013-11-03 23:03:57 +00:00
}