Rev 8 | Rev 10 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8 | Rev 9 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/usr/bin/php |
1 | #!/usr/bin/php |
2 | <?php |
2 | <?php |
3 | 3 | ||
4 | /* |
4 | /* |
5 | * ViaThinkSoft LogViewer |
5 | * ViaThinkSoft LogViewer |
6 | * Copyright 2018-2019 Daniel Marschall, ViaThinkSoft |
6 | * Copyright 2018-2022 Daniel Marschall, ViaThinkSoft |
7 | * |
7 | * |
8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
9 | * you may not use this file except in compliance with the License. |
9 | * you may not use this file except in compliance with the License. |
10 | * You may obtain a copy of the License at |
10 | * You may obtain a copy of the License at |
11 | * |
11 | * |
Line 22... | Line 22... | ||
22 | die("Error: This script can only be called from command line.\n"); |
22 | die("Error: This script can only be called from command line.\n"); |
23 | } |
23 | } |
24 | 24 | ||
25 | $hostname = trim(file_get_contents('/etc/hostname')); |
25 | $hostname = trim(file_get_contents('/etc/hostname')); |
26 | 26 | ||
27 | if (file_exists(__DIR__."/config_$hostname.inc.php")) { |
27 | if (file_exists(__DIR__."/../config_$hostname.inc.php")) { |
28 | require_once __DIR__."/config_$hostname.inc.php"; |
28 | require_once __DIR__."/../config_$hostname.inc.php"; |
29 | } else { |
29 | } else { |
30 | require_once __DIR__.'/config.inc.php'; |
30 | require_once __DIR__.'/../config.inc.php'; |
31 | } |
31 | } |
32 | 32 | ||
33 | if (file_exists(__DIR__."/../db_$hostname.inc.php")) { |
33 | if (file_exists(__DIR__."/../db_$hostname.inc.php")) { |
34 | require_once __DIR__."/../db_$hostname.inc.php"; |
34 | require_once __DIR__."/../db_$hostname.inc.php"; |
35 | } else { |
35 | } else { |