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
|
|
|
|
|
|
|
|
# Commit modifications
|
|
|
|
uci commit
|
|
|
|
|
|
|
|
# Delete file
|
|
|
|
rm -f "${default_config}"
|
|
|
|
|
|
|
|
/etc/init.d/emissary-agent enable
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|