Skip to content

Instantly share code, notes, and snippets.

@xabbu
Created May 26, 2020 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xabbu/e558912ccb4719ead4489a22822253ec to your computer and use it in GitHub Desktop.
Save xabbu/e558912ccb4719ead4489a22822253ec to your computer and use it in GitHub Desktop.
#!/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
[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