1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-01-23 02:14:48 +00:00

Fix symlink and perms for weathermap plugin configs folder (#301)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-08-13 01:46:30 +02:00 committed by GitHub
parent dc731efce3
commit 0af72265d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,21 @@ sed -i -e "s/RANDOMSTRINGGOESHERE/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmpd.c
# Init files and folders
echo "Initializing LibreNMS files / folders..."
mkdir -p /data/config /data/logs /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
ln -sf /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
if [ -d "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ] && [ ! -L "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ]; then
rm -rf ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
fi
if [ ! -L "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ]; then
ln -sf /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
fi
chown -h librenms:librenms ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
chown -R librenms:librenms /data/weathermap
# cleanup bad symlink: https://github.com/librenms/docker/issues/294#issuecomment-1190389960
if [ -L "/data/weathermap/weathermap" ]; then
rm /data/weathermap/weathermap
fi
touch /data/logs/librenms.log
rm -rf ${LIBRENMS_PATH}/logs
rm -f ${LIBRENMS_PATH}/config.d/*