From 960e2dc1805659cd9ddcc32fea331ec9ec67db9e Mon Sep 17 00:00:00 2001 From: Elizabeth Cray Date: Wed, 11 Mar 2026 18:43:49 -0400 Subject: [PATCH] Add SystemD Setup tool --- .gitignore | 5 ++++- install-systemd.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 install-systemd.sh diff --git a/.gitignore b/.gitignore index b44d4f3..6514fca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ config.json devices.json -node_modules/ \ No newline at end of file +node_modules/ +run.sh +watch.sh +dec0ntamination.service diff --git a/install-systemd.sh b/install-systemd.sh new file mode 100755 index 0000000..5de4202 --- /dev/null +++ b/install-systemd.sh @@ -0,0 +1,38 @@ +#!/bin/bash +npm install + +cat < run.sh +#!/bin/bash +cd `pwd` +`which node` run.js +EOF + +cat < watch.sh +#!/bin/bash +cd `pwd` +`which node` watcher.js +EOF + +chmod +x run.sh watch.sh + +cat < dec0ntamination.service +[Unit] +Description=Deconz Logger to Influx and Door Chime +After=network.target + +[Service] +Type=simple +ExecStart=`pwd`/watch.sh +Restart=always +RestartSec=10 +User=1000 + +[Install] +WantedBy=multi-user.target +EOF + +sudo cp dec0ntamination.service /etc/systemd/system/dec0ntamination.service + +sudo systemctl daemon-reload + +sudo systemctl enable --now dec0ntamination.service