Created
May 26, 2020 20:05
-
-
Save xabbu/e558912ccb4719ead4489a22822253ec to your computer and use it in GitHub Desktop.
This file contains 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 | |
APPLICATION_NAME=30sek | |
PPP=$( pwd ) | |
echo "$1" | |
echo "$2" | |
echo "$PPP" | |
if [[ "$1" == "start" ]] | |
then | |
echo "run the start block" | |
exec "./$APPLICATION_NAME" & disown | |
fi | |
if [[ "$1" == "stop" ]] | |
then | |
echo "run the stop block" | |
pkill $APPLICATION_NAME | |
exit 0 | |
fi |
This file contains 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
[Unit] | |
Description=Test Application | |
[Service] | |
SyslogIdentifier=Test_Application | |
WorkingDirectory=/usr/local/bin | |
Type=forking | |
User=xabbu | |
Group=xabbu | |
ExecStart=/usr/local/bin/service.sh start 2second | |
ExecStop=/usr/local/bin/service.sh stop 2second-stop | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment