17 lines
568 B
Bash
Raw Normal View History

2019-09-06 04:35:52 +00:00
#!/bin/sh
2019-09-06 04:51:26 +00:00
ROOT=$PWD
2019-09-06 04:35:52 +00:00
INSTALLPATH="/etc/systemd/system/"
GOBIN="$(go env GOPATH)/bin"
2019-09-06 04:35:52 +00:00
cd $(dirname $0)
for service in *.service; do
2019-09-06 04:35:52 +00:00
[ -f "$service" ] &&
echo "Installing services/$service" &&
2019-09-06 04:46:14 +00:00
sudo cp "$service" "$INSTALLPATH/$service" &&
2019-09-06 04:35:52 +00:00
sudo sed -i "s|MAKEFILE_USER|$USER|g" "$INSTALLPATH/$service" &&
sudo sed -i "s|MAKEFILE_GOBIN|$GOBIN|g" "$INSTALLPATH/$service" &&
2019-09-06 04:51:26 +00:00
sudo sed -i "s|MAKEFILE_PWD|$ROOT|g" "$INSTALLPATH/$service"
2019-09-06 04:35:52 +00:00
done
sudo systemctl daemon-reload &&
2019-09-06 04:35:52 +00:00
echo -e "\nYou can now start the service using:\n\nsudo systemctl start animenotifier.service"