mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-29 20:04:05 +02:00
GitHub bot : README updated
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
bashio::log.warning "NetBird service stopped; s6 will restart it if configured."
|
||||
56
netbird-server/netbird/rootfs/etc/services.d/netbird/run
Normal file
56
netbird-server/netbird/rootfs/etc/services.d/netbird/run
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
DATA_PATH=$(bashio::config 'data_path')
|
||||
LOG_LEVEL=$(bashio::config 'log_level')
|
||||
MANAGEMENT_PORT=$(bashio::config 'management_port')
|
||||
SIGNAL_PORT=$(bashio::config 'signal_port')
|
||||
DASHBOARD_PORT=$(bashio::config 'dashboard_port')
|
||||
MANAGEMENT_DNS_DOMAIN=$(bashio::config 'management_dns_domain')
|
||||
SINGLE_ACCOUNT_DOMAIN=$(bashio::config 'single_account_domain')
|
||||
|
||||
CONFIG_FILE="${DATA_PATH}/management.json"
|
||||
|
||||
if [[ ! -f "${CONFIG_FILE}" ]]; then
|
||||
bashio::log.error "management.json not found at ${CONFIG_FILE}."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MGMT_ARGS=(management --config "${CONFIG_FILE}" --log-file console --log-level "${LOG_LEVEL}" --port "${MANAGEMENT_PORT}")
|
||||
|
||||
if bashio::config.true 'disable_anonymous_metrics'; then
|
||||
MGMT_ARGS+=("--disable-anonymous-metrics=true")
|
||||
fi
|
||||
|
||||
if [[ -n "${SINGLE_ACCOUNT_DOMAIN}" ]]; then
|
||||
MGMT_ARGS+=("--single-account-mode-domain=${SINGLE_ACCOUNT_DOMAIN}")
|
||||
fi
|
||||
|
||||
if [[ -n "${MANAGEMENT_DNS_DOMAIN}" ]]; then
|
||||
MGMT_ARGS+=("--dns-domain=${MANAGEMENT_DNS_DOMAIN}")
|
||||
fi
|
||||
|
||||
SIGNAL_ARGS=(run --log-file console --port "${SIGNAL_PORT}")
|
||||
|
||||
if [[ -n "${NETBIRD_MGMT_API_CERT_FILE}" && -n "${NETBIRD_MGMT_API_CERT_KEY_FILE}" ]]; then
|
||||
SIGNAL_ARGS+=("--cert-file" "${NETBIRD_MGMT_API_CERT_FILE}" "--cert-key" "${NETBIRD_MGMT_API_CERT_KEY_FILE}")
|
||||
fi
|
||||
|
||||
bashio::log.info "Starting NetBird management"
|
||||
/usr/local/bin/netbird-mgmt "${MGMT_ARGS[@]}" &
|
||||
MGMT_PID=$!
|
||||
|
||||
bashio::log.info "Starting NetBird signal"
|
||||
/usr/local/bin/netbird-signal "${SIGNAL_ARGS[@]}" &
|
||||
SIGNAL_PID=$!
|
||||
|
||||
if bashio::config.true 'enable_dashboard'; then
|
||||
bashio::log.info "Preparing NetBird dashboard on port ${DASHBOARD_PORT}"
|
||||
/usr/local/init_react_envs.sh
|
||||
bashio::log.info "Starting NetBird dashboard (nginx)"
|
||||
nginx -g "daemon off;" &
|
||||
DASHBOARD_PID=$!
|
||||
fi
|
||||
|
||||
wait -n "${MGMT_PID}" "${SIGNAL_PID}" ${DASHBOARD_PID:+"${DASHBOARD_PID}"}
|
||||
Reference in New Issue
Block a user