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:
parent
b01af8010d
commit
e849092a4d
@ -69,6 +69,8 @@ GetOptions() {
|
|||||||
user=''
|
user=''
|
||||||
service=''
|
service=''
|
||||||
LC_NUMERIC="C"
|
LC_NUMERIC="C"
|
||||||
|
script_name=$(basename "${0}")
|
||||||
|
script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
GetOptions "$@"
|
GetOptions "$@"
|
||||||
|
|
||||||
if [[ $(systemctl ${user} list-unit-files "${service}*" | wc -l) -gt 3 ]]; then
|
if [[ $(systemctl ${user} list-unit-files "${service}*" | wc -l) -gt 3 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user