-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathrun.sh
51 lines (43 loc) · 977 Bytes
/
run.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
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
CONFIG_PATH=/data/options.json
MODE=$(jq --raw-output '.mode // empty' $CONFIG_PATH)
LOG=$(jq --raw-output '.log // empty' $CONFIG_PATH)
echo "--- VERSIONS ---"
echo "add-on version: 0.0.1"
echo -n "neolink version: " && neolink --version
echo "neolink mode: ${MODE}"
echo "neolink log: ${LOG}"
echo "ATTENTION: if you expected a newer Neolink version, please reinstall this Add-on!"
echo "--- Neolink ---"
case $LOG in
debug)
export RUST_LOG="neolink=debug"
;;
info)
export RUST_LOG="neolink=info"
;;
warn)
export RUST_LOG="neolink=warn"
;;
error)
export RUST_LOG="neolink=error"
;;
*)
echo -n "Unknown log level"
;;
esac
case $MODE in
rtsp)
neolink rtsp --config /config/addons/neolink.toml
;;
mqtt)
neolink mqtt --config /config/addons/neolink.toml
;;
dual)
neolink mqtt-rtsp --config /config/addons/neolink.toml
;;
*)
echo -n "Unknown mode option"
;;
esac