diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2020-06-23 10:17:42 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2020-06-23 10:17:42 +0300 |
| commit | 53e1ddb84aca67934e55ff27620ee4df6622ad97 (patch) | |
| tree | 0a18b19a39cd8ff91a42656586adb03795dcb392 | |
| parent | 4b7305c3d1f668671bd6eef05ed0996faf78d961 (diff) | |
| parent | 9a5630dc8f9af2ac7c626036707765acd2a86d22 (diff) | |
Merge branch 'feature/systemd-support'
| -rw-r--r-- | libs/services.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/services.php b/libs/services.php index a3f9e94..c61ac38 100644 --- a/libs/services.php +++ b/libs/services.php @@ -5,7 +5,7 @@ $Config = new Config(); $datas = array(); -$available_protocols = array('tcp', 'udp', 'unix'); +$available_protocols = array('tcp', 'udp', 'unix', 'systemd'); $show_port = $Config->get('services:show_port'); @@ -25,8 +25,11 @@ if (count($Config->get('services:list')) > 0) else $status = 0; } + elseif ($protocol == 'systemd') { + $status = Misc::systemdServiceActive($host) ? 0 : 1; + } else { - $status = Misc::systemdServiceActive($host) ? 1 : 0; + throw new Exception('Invalid protocol: ' . $protocol); } $datas[] = array( |
