add install and install-service scripts update readme

master
David Kebler 2020-07-02 17:22:12 -07:00
parent e69e6fb2db
commit e4d19d0e09
3 changed files with 26 additions and 12 deletions

10
install Executable file → Normal file
View File

@ -1,9 +1,3 @@
#!/bin/bash
sudo rm /etc/systemd/system/node-red@.service
sudo ln -s /opt/node-red-run/node-red.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable node-red
sudo systemctl restart node-red
sleep 5
sudo journalctl --unit=node-red -n 50 --no-pager
exit 1
sudo npm install -g --unsafe-perm node-red
sudo npm install -g esm

9
install-service Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
sudo rm /etc/systemd/system/node-red@.service
sudo ln -s /opt/node-red-run/node-red.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable node-red
sudo systemctl restart node-red
sleep 5
sudo journalctl --unit=node-red -n 50 --no-pager
exit 1

View File

@ -2,10 +2,21 @@
This repo aids in keeping node-red up to date and running via a systemd Service
install nodered and esm globally
Clone this repo
sudo npm install -g --unsafe-perm node-red && sudo npm install -g esm
git clone https://git.kebler.net/IOT/node-red-run.git /opt/node-red-run && \
cd /opt/node-red-run && \
./install
Just clone repo to `/opt`
you can try running nodered `./run <dir>`
<dir> is optional user directory if unset will be `/opt/node-red`
you can run the /.start script
if that works fine then if need be edit the node-red.service file environment varaiable for alternative user directory otherwise it will use the default `/opt/node-red`
run `./install-service` script
all should be find and the node-red should be running at :1880
`./start` and `./stop` script are systemctl aliases which can used after install
run `./update` to update the latest version of node-red and esm