Created
March 24, 2025 13:17
-
-
Save Scott-Nx/c1a5663b173972438a19cfd1cbc22962 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| SERVICE="avahi-daemon.service" | |
| start_service() { | |
| systemctl start $SERVICE | |
| echo "$SERVICE started." | |
| notify-send "Service Notification" "$SERVICE started." | |
| } | |
| stop_service() { | |
| systemctl stop $SERVICE | |
| echo "$SERVICE stopped." | |
| notify-send "Service Notification" "$SERVICE stopped." | |
| } | |
| if systemctl is-active --quiet $SERVICE; then | |
| stop_service | |
| else | |
| start_service | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment