2023-02-26 19:15:24 +01:00
|
|
|
#/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
main() {
|
2023-03-29 12:23:28 +02:00
|
|
|
local default_config="/data/emissary/default.conf"
|
2023-02-26 19:15:24 +01:00
|
|
|
|
|
|
|
if [ ! -f "${default_config}" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
source "${default_config}"
|
|
|
|
|
|
|
|
if [ ! -z "${EMISSARY_RECONCILIATION_INTERVAL}" ]; then
|
|
|
|
uci set "emissary.agent.reconciliation_interval=${EMISSARY_RECONCILIATION_INTERVAL}"
|
|
|
|
fi
|
|
|
|
if [ ! -z "${EMISSARY_SERVER_URL}" ]; then
|
|
|
|
uci set "emissary.agent.server_url=${EMISSARY_SERVER_URL}"
|
|
|
|
fi
|
2023-10-13 12:29:51 +02:00
|
|
|
if [ ! -z "${EMISSARY_SENTRY_DSN}" ]; then
|
|
|
|
uci set "emissary.agent.sentry_dsn=${EMISSARY_SENTRY_DSN}"
|
|
|
|
fi
|
|
|
|
if [ ! -z "${EMISSARY_SENTRY_ENVIRONMENT}" ]; then
|
|
|
|
uci set "emissary.agent.sentry_environment=${EMISSARY_SENTRY_ENVIRONMENT}"
|
|
|
|
fi
|
2023-02-26 19:15:24 +01:00
|
|
|
|
|
|
|
# Commit modifications
|
|
|
|
uci commit
|
|
|
|
|
|
|
|
# Delete file
|
|
|
|
rm -f "${default_config}"
|
|
|
|
|
|
|
|
/etc/init.d/emissary-agent enable
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|