-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·55 lines (44 loc) · 1.08 KB
/
test.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
#!/bin/bash
if [[ ! $(whoami) = "root" ]]
then
echo "Usage: Must be root"
exit 1
fi
if [ "$#" -ne 1 ]
then
echo "Usage: Must supply a domain"
exit 1
fi
DOMAIN=$1
echo "=======> testing the DNS server :"
tries=0
if [[ ! -z "$(nslookup ns.$DOMAIN 192.168.5.3 | grep NXDOMAIN )" ]]
then
echo "=======> DNS server not working"
else
echo "=======> DNS server working"
fi
echo "=======> testing the NFS server :"
curl 192.168.5.5:2049
if [[ ! $? -eq 52 ]]
then
echo "=======> NFS server not working"
else
echo "=======> NFS server working"
fi
echo "=======> testing the main node :"
res=$(curl http://$DOMAIN --resolve $DOMAIN:80:192.168.5.10 )
if [[ -z "$res" ]] | [[ ! $? -eq 0 ]]
then
echo "=======> main node not working"
else
echo "=======> main node working"
fi
echo "=======> testing the jenkins interface :"
res=$(curl http://jenkins.devops.$DOMAIN --resolve jenkins.devops.$DOMAIN:80:192.168.5.100 )
if [[ -z "$res" ]] | [[ ! $? -eq 0 ]]
then
echo "=======> jenkins interface not working"
else
echo "=======> jenkins interface working"
fi