Skip to content

Instantly share code, notes, and snippets.

@bartread
Last active August 14, 2024 13:10
Show Gist options
  • Save bartread/d169a4416cefc306a666e2fec2f62eb3 to your computer and use it in GitHub Desktop.
Save bartread/d169a4416cefc306a666e2fec2f62eb3 to your computer and use it in GitHub Desktop.
Bash script for installing systemd service on Ubuntu
#! /bin/sh
# Other deployment actions here. Want to install (or bounce) service last.
if [ -f /etc/systemd/system/arcadely.service ]; then
sudo systemctl stop arcadely.service
sudo systemctl disable arcadely.service
else
sudo \cp -f ./arcadely.service /etc/systemd/system/arcadely.service
fi
sudo systemctl enable arcadely.service
sudo systemctl start arcadely.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment