Skip to content

Commit

Permalink
Update README - installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Vojacek authored Apr 17, 2023
1 parent f90b43b commit 578c010
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

0 comments on commit 578c010

Please sign in to comment.