mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
hadolint
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Displays a simple add-on banner on startup
|
||||
# ==============================================================================
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
###################################
|
||||
# Export all addon options as env #
|
||||
@@ -16,7 +17,7 @@ for KEYS in ${arr[@]}; do
|
||||
line="${KEYS}=${VALUE//[\"\']/}"
|
||||
# Use locally
|
||||
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
|
||||
# Export the variable to run scripts
|
||||
# Export the variable to run scripts
|
||||
line="${KEYS}=${VALUE//[\"\']/} 2>/dev/null || true"
|
||||
[ -f /etc/services.d/*/*run* ] && sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null
|
||||
[ -f /etc/cont-init.d/*run* ] && sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
JSONTOCHECK='/config/transmission/settings.json'
|
||||
JSONSOURCE='/defaults/settings.json'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
##################
|
||||
# INITIALIZATION #
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
###############
|
||||
# DNS SETTING #
|
||||
@@ -7,22 +8,21 @@
|
||||
# Avoid usage of local dns such as adguard home or pihole\n"
|
||||
|
||||
if bashio::config.has_value 'DNS_server'; then
|
||||
# Define variables
|
||||
DNSSERVER=$(bashio::config 'DNS_server')
|
||||
DNS=""
|
||||
DNSLIST=""
|
||||
# Define variables
|
||||
DNSSERVER=$(bashio::config 'DNS_server')
|
||||
DNS=""
|
||||
DNSLIST=""
|
||||
|
||||
# Get DNS servers
|
||||
for server in ${DNSSERVER//,/ } # Separate comma separated values
|
||||
do
|
||||
DNS="${DNS}nameserver $server\n"
|
||||
DNSLIST="$server $DNSLIST"
|
||||
done
|
||||
# Get DNS servers
|
||||
for server in ${DNSSERVER//,/ }; do # Separate comma separated values
|
||||
DNS="${DNS}nameserver $server\n"
|
||||
DNSLIST="$server $DNSLIST"
|
||||
done
|
||||
|
||||
# Write resolv.conf
|
||||
printf "${DNS}" > /etc/resolv.conf
|
||||
chmod 644 /etc/resolv.conf
|
||||
bashio::log.info "DNS SERVERS set to $DNSLIST"
|
||||
# Write resolv.conf
|
||||
printf "${DNS}" >/etc/resolv.conf
|
||||
chmod 644 /etc/resolv.conf
|
||||
bashio::log.info "DNS SERVERS set to $DNSLIST"
|
||||
else
|
||||
bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers."
|
||||
bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers."
|
||||
fi
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
###############
|
||||
# SILENT MODE #
|
||||
###############
|
||||
|
||||
if bashio::config.true 'silent'; then
|
||||
APPEND=' > /dev/null'
|
||||
[ -f /etc/services.d/*/run ] && sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run
|
||||
[ -f /etc/cont-init.d/*/*run* ] && sed -i '$s|$|'"$APPEND"'|' /etc/cont-init.d/*/*run*
|
||||
bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.'
|
||||
APPEND=' > /dev/null'
|
||||
[ -f /etc/services.d/*/run ] && sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run
|
||||
[ -f /etc/cont-init.d/*/*run* ] && sed -i '$s|$|'"$APPEND"'|' /etc/cont-init.d/*/*run*
|
||||
bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.'
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
######################
|
||||
# MOUNT LOCAL SHARES #
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
#########################
|
||||
# MOUNT SMB SHARES v1.6 #
|
||||
|
||||
Reference in New Issue
Block a user