From 244c0a4a2e6138c9b1349e8b6d9d428a3b634b7c Mon Sep 17 00:00:00 2001 From: simono41 Date: Tue, 21 Nov 2017 18:18:06 +0100 Subject: [PATCH] systemctl-test --- systemctl-test.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 systemctl-test.sh diff --git a/systemctl-test.sh b/systemctl-test.sh new file mode 100755 index 0000000..f5c4ad1 --- /dev/null +++ b/systemctl-test.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -ex + +# The service we want to check (according to systemctl) +SERVICE=openvpn-client@client.service + +if [ "`systemctl is-active $SERVICE`" != "active" ] +then + echo "$SERVICE wasnt running so attempting restart" +fi +echo "$SERVICE is currently running"