25 lines
394 B
Bash
25 lines
394 B
Bash
#!/bin/bash -e
|
|
|
|
LOCK_FILE=/var/lock/4_environment.lock
|
|
|
|
if [ -f "$LOCK_FILE" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
function addConfig() {
|
|
if [ -n "${!1}" ]; then
|
|
echo "export $1=${!1}" >> /etc/librenms_environment
|
|
fi
|
|
}
|
|
|
|
addConfig DB_HOST
|
|
addConfig DB_USER
|
|
addConfig DB_PASS
|
|
addConfig DB_NAME
|
|
addConfig BASE_URL
|
|
addConfig MEMCACHED_ENABLE
|
|
addConfig MEMCACHED_HOST
|
|
addConfig MEMCACHED_PORT
|
|
|
|
touch "$LOCK_FILE"
|