]> git.basschouten.com Git - pithrottler.git/commitdiff
Add install script and service definition file.
authorBas Schouten <bas@basschouten.com>
Mon, 22 Apr 2024 07:52:17 +0000 (08:52 +0100)
committerBas Schouten <bas@basschouten.com>
Mon, 22 Apr 2024 07:52:17 +0000 (08:52 +0100)
install.sh [new file with mode: 0755]
pithrottler.service [new file with mode: 0644]

diff --git a/install.sh b/install.sh
new file mode 100755 (executable)
index 0000000..b8ef08f
--- /dev/null
@@ -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 (file)
index 0000000..957beb9
--- /dev/null
@@ -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
+