-
-
Notifications
You must be signed in to change notification settings - Fork 309
Expand file tree
/
Copy path09-install-plugins.sh
More file actions
34 lines (27 loc) · 857 Bytes
/
09-install-plugins.sh
File metadata and controls
34 lines (27 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/with-contenv sh
# shellcheck shell=sh
set -e
INSTALL_PLUGINS=${INSTALL_PLUGINS:-0}
SIDECAR_DISPATCHER=${SIDECAR_DISPATCHER:-0}
SIDECAR_SYSLOGNG=${SIDECAR_SYSLOGNG:-0}
SIDECAR_SNMPTRAPD=${SIDECAR_SNMPTRAPD:-0}
# Exit if any sidecar is enabled
if [ "$SIDECAR_DISPATCHER" = "1" ] || [ "$SIDECAR_SYSLOGNG" = "1" ] || [ "$SIDECAR_SNMPTRAPD" = "1" ]; then
exit 0
fi
# Exit if plugins are not needed
if [ "$INSTALL_PLUGINS" = "0" ]; then
exit 0
fi
echo ">> Plugin configuration detected"
echo "Fixing permissions..."
chown librenms:librenms \
"${LIBRENMS_PATH}"/composer.* \
"${LIBRENMS_PATH}/logs/librenms.log" \
"${LIBRENMS_PATH}/scripts/composer_wrapper.php"
chown -R librenms:librenms \
"${LIBRENMS_PATH}/scripts" \
"${LIBRENMS_PATH}/vendor" \
"${LIBRENMS_PATH}/bootstrap"
# Install plugins
lnms plugin:add "$INSTALL_PLUGINS"