summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/charts.d.plugin/libreswan/libreswan.chart.sh (renamed from charts.d/libreswan.chart.sh)9
1 files changed, 6 insertions, 3 deletions
diff --git a/charts.d/libreswan.chart.sh b/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
index 30632e9ce..6e29f8473 100644
--- a/charts.d/libreswan.chart.sh
+++ b/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
@@ -1,9 +1,10 @@
+# shellcheck shell=bash disable=SC1117
# no need for shebang - this file is loaded from charts.d.plugin
+# SPDX-License-Identifier: GPL-3.0-or-later
# netdata
# real-time performance and health monitoring, done right!
# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
-# GPL v3+
#
# _update_every is a special variable - it holds the number of seconds
@@ -60,7 +61,8 @@ libreswan_get() {
libreswan_connected_tunnels=()
# convert the ipsec command output to a shell script
- # and source it to get the values
+ # and source it to get the values
+ # shellcheck disable=SC1090
source <(
{
libreswan_ipsec whack --status;
@@ -85,6 +87,7 @@ libreswan_check() {
require_cmd ipsec || return 1
# make sure it is libreswan
+ # shellcheck disable=SC2143
if [ -z "$(ipsec --version | grep -i libreswan)" ]
then
error "ipsec command is not Libreswan. Disabling Libreswan plugin."
@@ -140,7 +143,7 @@ libreswan_update_one() {
[ -z "${id}" ] && libreswan_create_one "${name}"
- uptime=$(( ${libreswan_now} - ${libreswan_established_add_time[${n}]} ))
+ uptime=$(( libreswan_now - libreswan_established_add_time[${n}] ))
[ ${uptime} -lt 0 ] && uptime=0
# write the result of the work.