From d8975944d318a15c1a2a3c5890864c68f21e9f05 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Mon, 22 Apr 2024 08:52:17 +0100 Subject: [PATCH] Add install script and service definition file. --- install.sh | 5 +++++ pithrottler.service | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 install.sh create mode 100644 pithrottler.service diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..b8ef08f --- /dev/null +++ b/install.sh @@ -0,0 +1,5 @@ +#! /bin/bash +npm install +sudo cp pithrottler.service /etc/systemd/system/pithrottler.service +sudo systemctl enable pithrottler.service +sudo systemctl restart pithrottler.service diff --git a/pithrottler.service b/pithrottler.service new file mode 100644 index 0000000..957beb9 --- /dev/null +++ b/pithrottler.service @@ -0,0 +1,15 @@ +[Unit] +Description=PiThrottler Daemon +After=network.target + +[Service] +ExecStart=/usr/bin/node /home/mozilla/pithrottler/pithrottler.js +Restart=always +User=mozilla +Group=mozilla +Environment=NODE_ENV=production +WorkingDirectory=/home/mozilla/pithrottler/ + +[Install] +WantedBy=multi-user.target + -- 2.47.3