changed layout to work as a repository in hassio
This commit is contained in:
parent
acb3cc1ad3
commit
471ec7023e
12 changed files with 47 additions and 14 deletions
8
plejd/rootfs/etc/services.d/plejd/finish
Normal file
8
plejd/rootfs/etc/services.d/plejd/finish
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Plejd
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
14
plejd/rootfs/etc/services.d/plejd/run
Normal file
14
plejd/rootfs/etc/services.d/plejd/run
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Plejd
|
||||
# Runs the Plejd service
|
||||
# ==============================================================================
|
||||
|
||||
bashio::log.info 'Starting the Plejd service...'
|
||||
|
||||
# Change working directory
|
||||
cd /plejd || bashio::exit.nok 'Unable to change working directory'
|
||||
|
||||
# Run the Plejd service
|
||||
chmod +x /usr/bin/plejd.sh
|
||||
exec /usr/bin/plejd.sh
|
||||
27
plejd/rootfs/usr/bin/plejd.sh
Normal file
27
plejd/rootfs/usr/bin/plejd.sh
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
SITE=$(jq --raw-output ".site" $CONFIG_PATH)
|
||||
USERNAME=$(jq --raw-output ".username" $CONFIG_PATH)
|
||||
PASSWORD=$(jq --raw-output ".password" $CONFIG_PATH)
|
||||
MQTTBROKER=$(jq --raw-output ".mqttBroker" $CONFIG_PATH)
|
||||
MQTTUSERNAME=$(jq --raw-output ".mqttUsername" $CONFIG_PATH)
|
||||
MQTTPASSWORD=$(jq --raw-output ".mqttPassword" $CONFIG_PATH)
|
||||
INCLUDEROOMSASLIGHTS=$(jq --raw-output ".includeRoomsAsLights" $CONFIG_PATH)
|
||||
|
||||
PLEJD_PATH=/data/plejd.json
|
||||
PLEJD_CONFIG="{
|
||||
\"site\": \"$SITE\",
|
||||
\"username\": \"$USERNAME\",
|
||||
\"password\": \"$PASSWORD\",
|
||||
\"mqttBroker\": \"$MQTTBROKER\",
|
||||
\"mqttUsername\": \"$MQTTUSERNAME\",
|
||||
\"mqttPassword\": \"$MQTTPASSWORD\",
|
||||
\"includeRoomsAsLights\": \"$INCLUDEROOMSASLIGHTS\"
|
||||
}
|
||||
"
|
||||
|
||||
echo "$PLEJD_CONFIG" > $PLEJD_PATH
|
||||
|
||||
exec node /plejd/main.js
|
||||
Loading…
Add table
Add a link
Reference in a new issue