-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHMIBSC_USE_NODERED.sh
41 lines (38 loc) · 1.43 KB
/
HMIBSC_USE_NODERED.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/bash
<<INFO_COMMENTS
This script which NodeRed is active on the HMIBSC. If using Docker,
Docker and NodeRed Container needs to be preinstalled.
####################################################################
##### Use Native OS NodeRed
curl -L https://raw.githubusercontent.com/jzhvymetal/HMIBSC_UPDATE/main/HMIBSC_USE_NODERED.sh | sh -s -- -u OS
##### Use Docker NodeRed
curl -L https://raw.githubusercontent.com/jzhvymetal/HMIBSC_UPDATE/main/HMIBSC_USE_NODERED.sh | sh -s -- -u DOCKER
####################################################################
INFO_COMMENTS
####Install additional CLI passed nodes and opkg packages
### For NodeJS node use -n
### For SE Node use -s
### For opkg packages use -o
while getopts "u:" opt
do
case "$OPTARG" in
OS ) echo "Enabling OS NodeRed"
##stop NodeRed Docker
docker stop mynodered
##update docker restart
docker update --restart=no mynodered
##start and enable OS nodered service
systemctl enable --now nodered
;;
DOCKER ) echo "Enabling Docker NodeRed"
##stop OS nodered service
systemctl stop nodered
##disable OS nodred service
systemctl disable nodered
##update docker restart
docker update --restart=always mynodered
##stop NodeRed Docker
docker start mynodered
;;
esac
done