mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
Github bot : script beautyshied
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
# TIMEZONE #
|
||||
############
|
||||
|
||||
if bashio::config.has_value 'TZ'; then
|
||||
TIMEZONE=$(bashio::config 'TZ')
|
||||
bashio::log.info "Setting timezone to $TIMEZONE"
|
||||
if [ -f /usr/share/zoneinfo/"$TIMEZONE" ]; then
|
||||
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
|
||||
echo "$TIMEZONE" >/etc/timezone
|
||||
else
|
||||
bashio::log.fatal "$TIMEZONE not found, are you sure it is a valid timezone?"
|
||||
fi
|
||||
if bashio::config.has_value 'TZ'; then
|
||||
TIMEZONE=$(bashio::config 'TZ')
|
||||
bashio::log.info "Setting timezone to $TIMEZONE"
|
||||
if [ -f /usr/share/zoneinfo/"$TIMEZONE" ]; then
|
||||
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
|
||||
echo "$TIMEZONE" >/etc/timezone
|
||||
else
|
||||
bashio::log.fatal "$TIMEZONE not found, are you sure it is a valid timezone?"
|
||||
fi
|
||||
fi
|
||||
|
||||
###################
|
||||
|
||||
@@ -24,15 +24,15 @@ declare keyfile
|
||||
port=$(bashio::addon.port 80)
|
||||
if bashio::var.has_value "${port}"; then
|
||||
bashio::config.require.ssl
|
||||
|
||||
|
||||
if bashio::config.true 'ssl'; then
|
||||
certfile=$(bashio::config 'certfile')
|
||||
keyfile=$(bashio::config 'keyfile')
|
||||
|
||||
|
||||
mv /etc/nginx/servers/direct-ssl.disabled /etc/nginx/servers/direct.conf
|
||||
sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/servers/direct.conf
|
||||
sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/servers/direct.conf
|
||||
|
||||
|
||||
else
|
||||
mv /etc/nginx/servers/direct.disabled /etc/nginx/servers/direct.conf
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user