-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pavel Vojacek
authored
Apr 17, 2023
1 parent
f90b43b
commit 578c010
Showing
1 changed file
with
18 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,35 +11,39 @@ | |
``` | ||
#!/bin/bash | ||
cd /home/pi/ | ||
sudo -v | ||
NU=$(logname) | ||
git clone [email protected]:fragaria/moonraker-spectoda-connector.git | ||
cd /home/pi/ | ||
path=$(pwd)/moonraker-spectoda-connector/npm start | ||
GROUP=$(id -gn) | ||
sudo -u $NU git clone https://github.com/fragaria/moonraker-spectoda-connector.git | ||
cd /home/pi/moonraker-spectoda-connector | ||
sudo -u $NU npm ci | ||
content='[Unit] | ||
Description=Bridge for connecting to Moonraker events Spectoda REST API | ||
After=network.target | ||
[Service] | ||
User='"$USER"' | ||
Group='"$GROUP"' | ||
ExecStart='"$path"' | ||
User=pi | ||
Group=pi | ||
WorkingDirectory=/home/pi/moonraker-spectoda-connector | ||
ExecStart=node index.js | ||
Restart=on-failure | ||
RestartSec=5s | ||
[Install] | ||
WantedBy=default.target' | ||
# create the service file | ||
echo "$content" | tee /etc/systemd/system/moonraker-spectoda-node-connector.service > /dev/null | ||
echo "$content" | tee /etc/systemd/system/moonraker-spectoda-connector.service > /dev/null | ||
# reload the daemon | ||
systemctl daemon-reload | ||
# enable the service | ||
systemctl enable --now moonraker-spectoda-node-connector | ||
systemctl enable --now moonraker-spectoda-connector | ||
``` | ||
|
||
## Emited labels | ||
|
@@ -69,12 +73,12 @@ systemctl enable --now moonraker-spectoda-node-connector | |
``` | ||
# to moonraker.conf add this: | ||
[update_manager moonraker-spectoda-node-connector] | ||
[update_manager moonraker-spectoda-connector] | ||
type: git_repo | ||
path: ~/moonraker-spectoda-node-connector | ||
origin: https://github.com/fragaria/moonraker-spectoda-node-connector.git | ||
path: ~/moonraker-spectoda-connector | ||
origin: https://github.com/fragaria/moonraker-spectoda-connector.git | ||
primary_branch: main | ||
enable_node_updates: True | ||
managed_services: | ||
moonraker-spectoda-node-connector | ||
``` | ||
moonraker-spectoda-connector | ||
``` |