-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-entry.sh
27 lines (22 loc) · 1002 Bytes
/
docker-entry.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
#!/bin/ash
# Ensures that configuration files for both SnapRAID and snapraid-runner are present
# in /config. In reality, both files should be edited manually before running this
# container to ensure correct operation.
# test for /etc/snapraid.conf being a file and not a link, delete if file.
if [ ! -L /etc/snapraid.conf ] && [ -f /etc/snapraid.conf ]; then
rm /etc/snapraid.conf
fi
# test if snapraid.conf is in /config, copy from /defaults/snapraid.conf.example if not.
if [ ! -f /config/snapraid.conf ]; then
echo "No config found. You must configure SnapRAID before running this container."
exit 1
fi
if [ ! -f /config/snapraid-runner.conf ]; then
echo "No config found. You must configure snapraid-runner before running this container"
exit 1
fi
# test if link is made between /etc/snapraid.conf and /config/snapraid.conf, make if not
if [ ! -L /etc/snapraid.conf ]; then
ln -s /config/snapraid.conf /etc/snapraid.conf
fi
/usr/sbin/crond -d 6 -c /etc/crontabs -f