update all

This commit is contained in:
2024-03-31 20:12:36 +02:00
parent 0a61199bd7
commit e64ae07eee
135 changed files with 9726 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash -e
LOCK_FILE=/var/lock/0_cron.lock
if [ -f "$LOCK_FILE" ]; then
exit 0
fi
if [ -z "$POLLERS" ]; then
POLLERS=8
fi
sed -i "s/PLACEHOLDER_POLLERS/$POLLERS/g" /etc/cron.d/librenms
touch "$LOCK_FILE"

View File

@ -0,0 +1,22 @@
#!/bin/bash -eu
LOCK_FILE=/var/lock/1_ssl.lock
if [ -f "$LOCK_FILE" ]; then
exit 0
fi
CONF_FILE=/etc/nginx/sites-available/librenms.https
SSL_CERT=/etc/nginx/ssl/ssl.crt
SSL_KEY=/etc/nginx/ssl/ssl.key
SSL_OCSP=/etc/nginx/ssl/ssl.ocsp.crt
if [ -f "$SSL_CERT" ] && [ -f "$SSL_KEY" ]; then
if [ -f "$SSL_OCSP" ]; then
sed -i 's/#ssl_trusted_certificate/ssl_trusted_certificate/g' "$CONF_FILE"
fi
ln -s "$CONF_FILE" /etc/nginx/sites-enabled/librenms.https
fi
touch "$LOCK_FILE"

View File

@ -0,0 +1,14 @@
#!/bin/bash -e
LOCK_FILE=/var/lock/2_ipv6.lock
if [ -f "$LOCK_FILE" ]; then
exit 0
fi
if [ -n "$DISABLE_IPV6" ]; then
sed -i 's/listen \[::\]:80/#listen [::]:80/g' /etc/nginx/sites-enabled/librenms.http
sed -i 's/listen \[::\]:443/#listen [::]:443/g' /etc/nginx/sites-available/librenms.https
fi
touch "$LOCK_FILE"

View File

@ -0,0 +1,20 @@
#!/bin/bash -e
function requireConfig() {
if [ -z ${!1} ]; then
echo "Error: $1 is unset"
exit 1
fi
}
requireConfig DB_HOST
requireConfig DB_USER
requireConfig DB_PASS
requireConfig DB_NAME
requireConfig BASE_URL
cp /opt/librenms/config.docker.php /opt/librenms/config.php
if [ -f /opt/librenms/config.custom.php ]; then
cat /opt/librenms/config.custom.php >> /opt/librenms/config.php
fi

View File

@ -0,0 +1,24 @@
#!/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"

View File

@ -0,0 +1,4 @@
#!/bin/bash -eu
chown -R librenms:librenms /opt/librenms/logs /opt/librenms/rrd
chmod -R u=rwX,g=rwX,o=rX /opt/librenms/logs /opt/librenms/rrd