Added support for Go installed services
This commit is contained in:
parent
985423e981
commit
712b9cdce1
@ -1,14 +1,16 @@
|
||||
#!/bin/sh
|
||||
INSTALLPATH="/etc/systemd/system/"
|
||||
GOBIN="$(go env GOPATH)/bin"
|
||||
cd $(dirname $0)
|
||||
|
||||
for service in *; do
|
||||
for service in *.service; do
|
||||
[ -f "$service" ] &&
|
||||
echo "Installing services/$service" &&
|
||||
sudo cp "services/$service" "$INSTALLPATH/$service" &&
|
||||
sudo sed -i "s|MAKEFILE_USER|$USER|g" "$INSTALLPATH/$service" &&
|
||||
sudo sed -i "s|MAKEFILE_GOBIN|$GOBIN|g" "$INSTALLPATH/$service" &&
|
||||
sudo sed -i "s|MAKEFILE_PWD|$PWD|g" "$INSTALLPATH/$service"
|
||||
done
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl daemon-reload &&
|
||||
echo -e "\nYou can now start the service using:\n\nsudo systemctl start animenotifier.service"
|
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Image Server
|
||||
After=animenotifier.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=MAKEFILE_USER
|
||||
ExecStart=MAKEFILE_GOBIN/imageserver
|
||||
WorkingDirectory=MAKEFILE_PWD
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Image Server
|
||||
After=animenotifier.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=MAKEFILE_USER
|
||||
ExecStart=MAKEFILE_GOBIN/japanese
|
||||
WorkingDirectory=MAKEFILE_PWD
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user