forked from af-silva/docker-munin-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·34 lines (28 loc) · 1.01 KB
/
start.sh
File metadata and controls
executable file
·34 lines (28 loc) · 1.01 KB
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
#!/bin/bash
# Apply munin-node allowed hosts
if [ ! -z ${ALLOWED_HOSTS+x} ]; then
sed -i -e 's@^cidr_allow.*@cidr_allow '"$ALLOWED_HOSTS"'@' /etc/munin/munin-node.conf
fi
# Apply user defined server name from ENV
if [ ! -z ${HOSTNAME+x} ]; then
sed -ie 's@localhost.localdomain@'"$HOSTNAME"'@g' /etc/munin/munin.conf
fi
# Apply user defined smtp_relay from ENV
if [ ! -z ${SMTP_RELAY+x} ]; then
sed -ie 's@RELAYHOST@'"$SMTP_RELAY"'@g' /etc/postfix/main.cf
fi
# Set timezone if supplied ENV{TZ} is valid
if [ -f "/usr/share/zoneinfo/$TZ" ]; then
rm /etc/localtime
ln -s "/usr/share/zoneinfo/$TZ" /etc/localtime
fi
# Create holding page if no stats are available
if [ ! -e /var/cache/munin/www/index.html ]; then
echo "NEW INSTALLATION: Charts will be available within 5 minutes, thank you for waiting..." > /var/cache/munin/www/index.htm
fi
munin-node-configure --remove --shell | sh
service cron start
service postfix start
a2enmod cgid
service apache2 start
exec /usr/sbin/munin-node --config /etc/munin/munin-node.conf