16 lines
566 B
Bash
Raw Normal View History

2019-09-06 04:35:52 +00:00
#!/bin/sh
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" &&
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" &&
2019-09-06 04:35:52 +00:00
sudo sed -i "s|MAKEFILE_PWD|$PWD|g" "$INSTALLPATH/$service"
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"