-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
bash_functions.sh
executable file
·57 lines (47 loc) · 1.63 KB
/
bash_functions.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -euf -o pipefail
function check_files() {
# check for needed config files
# these are mounted using docker-compose and are
# required by the setup
if [ ! -f RT_SiteConfig.pm ]; then
echo "RT_SiteConfig.pm does not exist. Please see RT_SiteConfig.pm.example for an example configuration."
exit 1
fi
if [ ! -f ./msmtp/msmtp.conf ]; then
echo "./msmtp/msmtp.conf does not exist. Please see msmtp.conf.example for an example configuration."
exit 1;
fi
if [ ! -f ./nginx/certs/pub.pem ]; then
echo "./nginx/certs/pub.pem does not exist. Please see Readme.md if you want to create a self signed certificate."
exit 1
fi
if [ ! -f ./nginx/certs/priv.pem ]; then
echo "./nginx/certs/priv.pem does not exist. Please see Readme.md if you want to create a self signed certificate."
exit 1
fi
if [ ! -f ./crontab ]; then
echo "./crontab does not exist. Please see crontab.example for an example configuration."
exit 1
fi
if [ ! -f ./getmail/getmailrc ]; then
echo "./getmail/getmailrc does not exist. Please see getmailrc.example for an example configuration."
exit 1
fi
}
function fix_file_perms() {
# needed for the gpg and smime stuff
# id 1000 is the rt user inside the docker image
chown -R 1000:1000 ./cron
chown -R 1000:1000 ./gpg
chown -R 1000:1000 ./smime
chown -R 1000:1000 ./shredder
chmod 0700 ./cron
chmod 0700 ./gpg
chmod 0700 ./smime
chmod 0700 ./shredder
find ./cron -type f -exec chmod 0600 {} \;
find ./gpg -type f -exec chmod 0600 {} \;
find ./smime -type f -exec chmod 0600 {} \;
find ./shredder -type f -exec chmod 0600 {} \;
}