diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2020-06-23 10:10:42 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2020-06-23 10:10:42 +0300 |
| commit | b3a7bc5c7ad0ebf65779be583ce236fa5129ef0d (patch) | |
| tree | fd6e77ce77f3dfc8129c805b8528f8fce3639f46 | |
| parent | 4b7305c3d1f668671bd6eef05ed0996faf78d961 (diff) | |
Enable systemd service 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..0c593cf 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,9 +25,12 @@ if (count($Config->get('services:list')) > 0) else $status = 0; } - else { + elseif ($protocol == 'systemd') { $status = Misc::systemdServiceActive($host) ? 1 : 0; } + else { + throw new Exception('Invalid protocol: ' . $protocol); + } $datas[] = array( 'port' => $show_port === true ? $port : '', |
