mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 02:31:51 +02:00
Lint
This commit is contained in:
@@ -46,7 +46,7 @@ for KEYS in "${arr[@]}"; do
|
|||||||
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
|
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
|
||||||
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
|
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
|
||||||
# For s6
|
# For s6
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ while IFS= read -r line; do
|
|||||||
sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null || true
|
sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null || true
|
||||||
sed -i "1a export $line" /scripts/*run* 2>/dev/null || true
|
sed -i "1a export $line" /scripts/*run* 2>/dev/null || true
|
||||||
# Export to s6
|
# Export to s6
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
||||||
# export to python
|
# export to python
|
||||||
if command -v "python3" &>/dev/null; then
|
if command -v "python3" &>/dev/null; then
|
||||||
[ ! -f /env.py ] && echo "import os" > /env.py
|
[ ! -f /env.py ] && echo "import os" > /env.py
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ sed -i "s|/config/addons_config/calibre|$LOCATION|g" /etc/cont-init.d/* || true
|
|||||||
sed -i "s|/config/addons_config/calibre|$LOCATION|g" /etc/services.d/*/run || true
|
sed -i "s|/config/addons_config/calibre|$LOCATION|g" /etc/services.d/*/run || true
|
||||||
|
|
||||||
if [ -d /var/run/s6/container_environment ]; then
|
if [ -d /var/run/s6/container_environment ]; then
|
||||||
printf "$LOCATION" > /var/run/s6/container_environment/HOME
|
printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME
|
||||||
printf "$LOCATION" > /var/run/s6/container_environment/FM_HOME
|
printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
usermod --home "$LOCATION" abc
|
usermod --home "$LOCATION" abc
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if bashio::config.has_value 'KEYBOARD'; then
|
|||||||
KEYBOARD=$(bashio::config 'KEYBOARD')
|
KEYBOARD=$(bashio::config 'KEYBOARD')
|
||||||
bashio::log.info "Setting keyboard to $KEYBOARD"
|
bashio::log.info "Setting keyboard to $KEYBOARD"
|
||||||
sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run
|
sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi
|
||||||
fi || true
|
fi || true
|
||||||
|
|
||||||
# Set cli args
|
# Set cli args
|
||||||
@@ -23,7 +23,7 @@ if bashio::config.has_value 'CLI_ARGS'; then
|
|||||||
CLI_ARGS=$(bashio::config 'CLI_ARGS')
|
CLI_ARGS=$(bashio::config 'CLI_ARGS')
|
||||||
bashio::log.info "Setting arguments to $CLI_ARGS"
|
bashio::log.info "Setting arguments to $CLI_ARGS"
|
||||||
sed -i "1a export CLI_ARGS=$CLI_ARGS" /etc/s6-overlay/s6-rc.d/svc-web/run
|
sed -i "1a export CLI_ARGS=$CLI_ARGS" /etc/s6-overlay/s6-rc.d/svc-web/run
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$CLI_ARGS" > /var/run/s6/container_environment/CLI_ARGS; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$CLI_ARGS" > /var/run/s6/container_environment/CLI_ARGS; fi
|
||||||
fi || true
|
fi || true
|
||||||
|
|
||||||
# Set password
|
# Set password
|
||||||
@@ -32,5 +32,5 @@ if bashio::config.has_value 'PASSWORD'; then
|
|||||||
PASSWORD=$(bashio::config 'PASSWORD')
|
PASSWORD=$(bashio::config 'PASSWORD')
|
||||||
bashio::log.info "Setting password to $PASSWORD"
|
bashio::log.info "Setting password to $PASSWORD"
|
||||||
sed -i "1a export PASSWORD=$PASSWORD" /etc/s6-overlay/s6-rc.d/svc-web/run
|
sed -i "1a export PASSWORD=$PASSWORD" /etc/s6-overlay/s6-rc.d/svc-web/run
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$PASSWORD" > /var/run/s6/container_environment/PASSWORD; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$PASSWORD" > /var/run/s6/container_environment/PASSWORD; fi
|
||||||
fi || true
|
fi || true
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ sed -i "1a export FM_HOME=$LOCATION" /etc/services.d/*/run
|
|||||||
sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /defaults/*
|
sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /defaults/*
|
||||||
sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /etc/cont-init.d/*
|
sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /etc/cont-init.d/*
|
||||||
sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /etc/services.d/*/run
|
sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /etc/services.d/*/run
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$LOCATION" > /var/run/s6/container_environment/HOME; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME; fi
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi
|
||||||
|
|
||||||
usermod --home "$LOCATION" abc
|
usermod --home "$LOCATION" abc
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if [ -n "${RC_SVCNAME}" ]; then
|
|||||||
# Re-enter the init script to start any dependant services
|
# Re-enter the init script to start any dependant services
|
||||||
if /etc/init.d/"${RC_SVCNAME}" --quiet status ; then
|
if /etc/init.d/"${RC_SVCNAME}" --quiet status ; then
|
||||||
export IN_BACKGROUND=true
|
export IN_BACKGROUND=true
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "true" > /var/run/s6/container_environment/IN_BACKGROUND; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "true" > /var/run/s6/container_environment/IN_BACKGROUND; fi
|
||||||
/etc/init.d/"${RC_SVCNAME}" --quiet stop
|
/etc/init.d/"${RC_SVCNAME}" --quiet stop
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ if [ -n "${RC_SVCNAME}" ]; then
|
|||||||
# Re-enter the init script to start any dependant services
|
# Re-enter the init script to start any dependant services
|
||||||
if ! /etc/init.d/"${RC_SVCNAME}" --quiet status ; then
|
if ! /etc/init.d/"${RC_SVCNAME}" --quiet status ; then
|
||||||
export IN_BACKGROUND=true
|
export IN_BACKGROUND=true
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "true" > /var/run/s6/container_environment/IN_BACKGROUND; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "true" > /var/run/s6/container_environment/IN_BACKGROUND; fi
|
||||||
/etc/init.d/${RC_SVCNAME} --quiet start
|
/etc/init.d/${RC_SVCNAME} --quiet start
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if [[ "$(bashio::config "Mode")" == Collector ]]; then
|
|||||||
if bashio::config.has_value "COLLECTOR_API_ENDPOINT"; then
|
if bashio::config.has_value "COLLECTOR_API_ENDPOINT"; then
|
||||||
echo "export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" >> /env.sh
|
echo "export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" >> /env.sh
|
||||||
sed -i "1a export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" /etc/services.d/collector-once/run
|
sed -i "1a export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" /etc/services.d/collector-once/run
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$COLLECTOR_API_ENDPOINT" > /var/run/s6/container_environment/COLLECTOR_API_ENDPOINT; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$COLLECTOR_API_ENDPOINT" > /var/run/s6/container_environment/COLLECTOR_API_ENDPOINT; fi
|
||||||
bashio::log.info "Using 'COLLECTOR_API_ENDPOINT' $(bashio::config "COLLECTOR_API_ENDPOINT")"
|
bashio::log.info "Using 'COLLECTOR_API_ENDPOINT' $(bashio::config "COLLECTOR_API_ENDPOINT")"
|
||||||
else
|
else
|
||||||
bashio::exit.nok "Mode is set to 'Collector', but 'COLLECTOR_API_ENDPOINT' is not defined"
|
bashio::exit.nok "Mode is set to 'Collector', but 'COLLECTOR_API_ENDPOINT' is not defined"
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /defaults -type f) || true
|
|||||||
sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/cont-init.d -type f) || true
|
sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/cont-init.d -type f) || true
|
||||||
sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/services.d -type f) || true
|
sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/services.d -type f) || true
|
||||||
sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/s6-overlay/s6-rc.d -type f) || true
|
sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/s6-overlay/s6-rc.d -type f) || true
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$LOCATION" > /var/run/s6/container_environment/HOME; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME; fi
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi
|
||||||
|
|
||||||
usermod --home "$LOCATION" abc
|
usermod --home "$LOCATION" abc
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ if bashio::config.has_value 'KEYBOARD'; then
|
|||||||
KEYBOARD=$(bashio::config 'KEYBOARD')
|
KEYBOARD=$(bashio::config 'KEYBOARD')
|
||||||
bashio::log.info "Setting keyboard to $KEYBOARD"
|
bashio::log.info "Setting keyboard to $KEYBOARD"
|
||||||
sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run
|
sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set password
|
# Set password
|
||||||
|
|||||||
Reference in New Issue
Block a user