-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_checks.sh
executable file
·34 lines (27 loc) · 1003 Bytes
/
install_checks.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
#!/bin/bash
# Author: AJRepo
# License: GPLv3
#Script to test zimbra and certbot environment to see if both are
#setup ok.
#run commands as zimbra user
if [[ $(whoami) != "zimbra" ]]; then
echo "Please run this script as user zimbra"
exit 1
fi
#Check name used
ZIMBRA_HOSTNAME=$(zmhostname)
echo "FQDN reported as $ZIMBRA_HOSTNAME"
#Check ports used (does it require port 80 for certbot?)
ZIMBRA_SERVER_PORT=$(zmprov getServer $ZIMBRA_HOSTNAME zimbraMailProxyPort)
#get all hostnames (gad)
ZIMBRA_ALL_DOMAINS=$(zmprov getAllDomains)
echo "Checking all domains to see if compatible with zimbra certbot renewal"
#get domain (gd)
for ZIMBRA_PUBLIC in $ZIMBRA_ALL_DOMAINS; do
THIS_PUBLIC_DOMAIN=$(zmprov getDomain $ZIMBRA_PUBLIC zimbraPublicServiceHostname | grep zimbraPublicServiceHostname | awk '{print $2}')
if [[ $THIS_PUBLIC_DOMAIN == $ZIMBRA_HOSTNAME ]]; then
echo "$ZIMBRA_PUBLIC is OK"
else
echo "$ZIMBRA_PUBLIC has $THIS_PUBLIC_DOMAIN domain instead of $ZIMBRA_HOSTNAME"
fi
done