mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 02:14:48 +00:00
Fix container restart state with Weathermap (#304)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
e95987bcf2
commit
d7496bbade
2 changed files with 13 additions and 12 deletions
|
|
@ -11,7 +11,6 @@ chown librenms:librenms \
|
|||
"${LIBRENMS_PATH}" \
|
||||
"${LIBRENMS_PATH}/.env"
|
||||
chown -R librenms:librenms \
|
||||
"${LIBRENMS_PATH}/html/plugins/Weathermap/output" \
|
||||
/home/librenms \
|
||||
/tpls \
|
||||
/var/lib/nginx \
|
||||
|
|
|
|||
|
|
@ -89,24 +89,26 @@ sed -i -e "s/RANDOMSTRINGGOESHERE/${LIBRENMS_SNMP_COMMUNITY}/" /etc/snmp/snmpd.c
|
|||
echo "Initializing LibreNMS files / folders..."
|
||||
mkdir -p /data/config /data/logs /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
|
||||
|
||||
if [ -d "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ] && [ ! -L "${LIBRENMS_PATH}/html/plugins/Weathermap/configs" ]; then
|
||||
rm -rf ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
|
||||
if [ -d "${LIBRENMS_PATH}/html/plugins/Weathermap" ]; then
|
||||
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 ${LIBRENMS_PATH}/html/plugins/Weathermap/output
|
||||
|
||||
# FIXME: bring back when weathermap plugin compatible with PHP 8
|
||||
# https://github.com/librenms/docker/issues/296
|
||||
rm -rf ${LIBRENMS_PATH}/html/plugins/Weathermap
|
||||
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
|
||||
|
||||
# FIXME: bring back when weathermap plugin compatible with PHP 8
|
||||
# https://github.com/librenms/docker/issues/296
|
||||
rm -rf ${LIBRENMS_PATH}/html/plugins/Weathermap
|
||||
|
||||
touch /data/logs/librenms.log
|
||||
rm -rf ${LIBRENMS_PATH}/logs
|
||||
rm -f ${LIBRENMS_PATH}/config.d/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue