From 110f331ec4619ec2b9bf6c9e13f1dd6895a1af32 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Mon, 16 Sep 2024 16:45:03 -0500 Subject: [PATCH] Update tabs/utils/service-control.sh Co-authored-by: Adam Perkowski --- tabs/utils/service-control.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tabs/utils/service-control.sh b/tabs/utils/service-control.sh index 719cda26..96aba4fc 100644 --- a/tabs/utils/service-control.sh +++ b/tabs/utils/service-control.sh @@ -55,7 +55,12 @@ add_service() { while [ -z "$SERVICE_NAME" ]; do echo "Enter the name of the new service (e.g., my_service):" read -r SERVICE_NAME - done + + if $ESCALATION_TOOL systemctl list-units --type=service --all --no-legend | grep -q "$SERVICE_NAME.service"; then + echo "Service already exists!" + SERVICE_NAME="" + fi + done echo "Enter the description of the service:" read -r SERVICE_DESCRIPTION