-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo_validate_test_server.sh
executable file
·65 lines (55 loc) · 1.81 KB
/
go_validate_test_server.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
58
59
60
61
62
63
64
65
#!/bin/bash
BASE=${HOME}/atlassian-tools
BIN="$BASE"/bin
. ${BASE}/conf/config.sh
. ${BASE}/lib/utils.sh
[[ $VERBOSE -eq $YES ]] && set -x
# stop_services.sh
# puppet ssl dir should not exist
[[ -f $(puppet agent --configprint agent_disabled_lockfile) ]] \
|| die "puppet agent still enabled"
success "Puppet is DISABLED!"
# disable_notifications.sh
# notifications should be disabled
grep -q '^[A-Za-z].\+atlassian.mail.senddisabled=true' "${APP_INSTALL_DIR}"/bin/setenv.sh \
|| die "Cant verify jira notifications are disabled"
success "Notifications are DISABLED!"
# fix_network.sh
# new IP should be in ifcfg file
grep -q "$IPADDR_NEW" /etc/sysconfig/network-scripts/* \
|| die "Did not find new IP in ifcfg"
success "New IP found in ifcfg!"
# ensure old IP is no in any ifcfg files
grep "$IPADDR_OLD" /etc/sysconfig/network-scripts/* \
&& die "Old IP was found in an ifcfg script"
success "Old IP no longer found in ifcfg scripts!"
# fix_cron.sh
# cron jobs should be all disabled
crontab -l | grep -q '^[^#]' \
&& die "Found a non-comment line in crontab"
success "No crontabs enabled!"
# fix_hostname.sh
# check hostname
hostnamectl status --static | grep -q "$HOSTNAME_NEW" \
|| die "Hostname does NOT match '$HOSTNAME_NEW'"
success "Hostname looks good!"
# fix_app_config.sh
# check server.xml
XML="$APP_INSTALL_DIR"/conf/server.xml
grep -F 'proxyName=' "$XML" | grep -q "$HOSTNAME_NEW" \
|| die "New hostname not found in '$XML'"
success "server.xml has new hostname"
# fix_keytab.sh
# check keytab
# Not fatal on failure
krb_ok=$YES
klist -k /etc/krb5.keytab | grep -q -F "${HOSTNAME_OLD}" && {
err "Old hostname still in keytab"
krb_ok=$NO
}
klist -k /etc/krb5.keytab | grep -q -F "${HOSTNAME_NEW}" || {
err "New hostname NOT in keytab"
krb_ok=$NO
}
[[ $krb_ok -eq $YES ]] \
&& success "KRB5 keytab looks good!"