From e849092a4db079be376549632350970fe0d98791 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Thu, 1 Jun 2023 16:09:07 +0200 Subject: [PATCH] Add script name and directory variables to check-systemctl-service.sh This commit adds two new variables, script_name and script_dir, to the check-systemctl-service.sh file. These variables are used to store the name of the script and its directory path respectively. --- check-systemctl-service.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check-systemctl-service.sh b/check-systemctl-service.sh index 21da0eb..b27fe44 100644 --- a/check-systemctl-service.sh +++ b/check-systemctl-service.sh @@ -69,6 +69,8 @@ GetOptions() { user='' service='' LC_NUMERIC="C" +script_name=$(basename "${0}") +script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) GetOptions "$@" if [[ $(systemctl ${user} list-unit-files "${service}*" | wc -l) -gt 3 ]]; then