-
Notifications
You must be signed in to change notification settings - Fork 0
/
magento_varnish_check.sh
41 lines (33 loc) · 1012 Bytes
/
magento_varnish_check.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
#!/bin/bash
varnish_status=`php bin/magento config:show | grep -a "caching" | cut -d " " -f 3`
access_list=`php bin/magento config:show | grep -a access_list`
backend_host=`php bin/magento config:show | grep -a backend_host`
echo
echo
echo "*********************varnish status check*********************"
echo
if [[ $varnish_status -eq 2 ]]
then echo 'Caching Application is selected as varnish'
else echo 'Magneto built in cache is selected, varnish is not working'
fi
echo
echo "####################################"
echo These are backend host URLs
echo $backend_host
echo
echo "####################################"
echo
echo These are access_list URLs
echo $access_list
echo
echo "###################################"
num=`php bin/magento config:show | grep -a "backend_port" | cut -d " " -f 3`
if [[ $num -eq 8081 ]]
then # if/then branch
echo 'varnish port is correct'
echo $num
else # else branch
echo $num
echo 'varnish port is not correct it should be 8081'
fi
echo