This commit is contained in:
2024-06-12 13:49:42 +02:00
commit b8e15ff09c
390 changed files with 37206 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
# openvpn-systemd
Show connection status of VPNs managed by systemd.
![](openvpn-systemd.png)
# Config
```ini
[openvpn-systemd]
command=$SCRIPT_DIR/openvpn-systemd
interval=20
label=VPN
```

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use JSON::Parse 'parse_json';
my $units = parse_json(`systemctl list-units --output=json --state=active 'openvpn-client@*'`);
if (@$units) {
my @names = sort map {
$_->{unit} =~ /^openvpn-client@(.*)\.service$/;
$1;
} @$units;
print join(' ', @names) . "\n";
print "up\n";
print "#00FF00\n";
} else {
print "down\n";
print "down\n";
print "#FF0000\n";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB