mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 18:43:39 +02:00
Beautify bash
This commit is contained in:
@@ -7,13 +7,13 @@
|
||||
|
||||
bashio::config.require.ssl
|
||||
if bashio::config.true 'ssl'; then
|
||||
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
|
||||
#set variables
|
||||
CERTFILE="-t /ssl/$(bashio::config 'certfile')"
|
||||
KEYFILE="-k /ssl/$(bashio::config 'keyfile')"
|
||||
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
|
||||
#set variables
|
||||
CERTFILE="-t /ssl/$(bashio::config 'certfile')"
|
||||
KEYFILE="-k /ssl/$(bashio::config 'keyfile')"
|
||||
else
|
||||
CERTFILE=""
|
||||
KEYFILE=""
|
||||
CERTFILE=""
|
||||
KEYFILE=""
|
||||
fi
|
||||
|
||||
#################
|
||||
@@ -32,7 +32,7 @@ export FB_BASEURL
|
||||
declare ADDON_PROTOCOL=http
|
||||
# Generate Ingress configuration
|
||||
if bashio::config.true 'ssl'; then
|
||||
ADDON_PROTOCOL=https
|
||||
ADDON_PROTOCOL=https
|
||||
fi
|
||||
|
||||
#port=$(bashio::addon.port 80)
|
||||
@@ -51,28 +51,28 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
|
||||
NOAUTH=""
|
||||
|
||||
if bashio::config.true 'NoAuth'; then
|
||||
if ! bashio::fs.file_exists "/data/noauth"; then
|
||||
rm /data/auth &>/dev/null || true
|
||||
rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true
|
||||
touch /data/noauth
|
||||
NOAUTH="--noauth"
|
||||
bashio::log.warning "Auth method change, database reset"
|
||||
fi
|
||||
bashio::log.info "NoAuth option selected"
|
||||
if ! bashio::fs.file_exists "/data/noauth"; then
|
||||
rm /data/auth &>/dev/null || true
|
||||
rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true
|
||||
touch /data/noauth
|
||||
NOAUTH="--noauth"
|
||||
bashio::log.warning "Auth method change, database reset"
|
||||
fi
|
||||
bashio::log.info "NoAuth option selected"
|
||||
else
|
||||
if ! bashio::fs.file_exists "/data/auth"; then
|
||||
rm /data/noauth &>/dev/null || true
|
||||
rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true
|
||||
touch /data/auth
|
||||
bashio::log.warning "Auth method change, database reset"
|
||||
fi
|
||||
bashio::log.info "Default username/password : admin/admin"
|
||||
if ! bashio::fs.file_exists "/data/auth"; then
|
||||
rm /data/noauth &>/dev/null || true
|
||||
rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true
|
||||
touch /data/auth
|
||||
bashio::log.warning "Auth method change, database reset"
|
||||
fi
|
||||
bashio::log.info "Default username/password : admin/admin"
|
||||
fi
|
||||
|
||||
if bashio::config.has_value 'base_folder'; then
|
||||
BASE_FOLDER=$(bashio::config 'base_folder')
|
||||
BASE_FOLDER=$(bashio::config 'base_folder')
|
||||
else
|
||||
BASE_FOLDER=/
|
||||
BASE_FOLDER=/
|
||||
fi
|
||||
|
||||
bashio::log.info "Starting..."
|
||||
|
||||
Reference in New Issue
Block a user