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.
This commit is contained in:
Jeroen De Meerleer 2023-06-01 16:09:07 +02:00
parent b01af8010d
commit e849092a4d
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 2 additions and 0 deletions

View File

@ -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