-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
executable file
·31 lines (23 loc) · 1.1 KB
/
setup.sh
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
#!/bin/sh
mkdir -p /var/cache/heartbeat /etc/heartbeat
if [ "`uname`" = "Linux" ] \
&& ! grep -q lxc /proc/1/environ 2>/dev/null \
&& ! grep -q /var/cache/heartbeat /etc/fstab; then
echo "setting up cache directory"
echo "tmpfs /var/cache/heartbeat tmpfs noatime,size=16m 0 0" >>/etc/fstab
mount /var/cache/heartbeat
fi
/opt/heartbeat/scripts/setup/configure-hostname.sh
/opt/heartbeat/scripts/setup/configure-symlinks.sh
if [ ! -f /proc/1/environ ] || ! grep -q lxc /proc/1/environ 2>/dev/null; then
echo "setting up SMART configuration files and templates"
/opt/heartbeat/scripts/setup/configure-smart.sh
echo "discovering drives connected to RAID controllers"
/opt/heartbeat/scripts/setup/detect-raid-drives.sh >/etc/heartbeat/detected-raid-drives.conf
fi
echo "discovering directories for disk space monitoring"
/opt/heartbeat/scripts/setup/detect-data-directories.sh >/etc/heartbeat/detected-data-directories.conf
if ! grep -q /opt/heartbeat/scripts/cron/update.sh /etc/crontab; then
echo "setting up crontab entries"
echo "*/2 * * * * root /opt/heartbeat/scripts/cron/update.sh" >>/etc/crontab
fi