Update tabs/utils/service-control.sh

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
This commit is contained in:
Chris Titus 2024-09-16 16:45:03 -05:00 committed by GitHub
parent d608d06fc9
commit 110f331ec4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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