forked from Percona-QA/package-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_check.sh
More file actions
executable file
·61 lines (55 loc) · 1.55 KB
/
client_check.sh
File metadata and controls
executable file
·61 lines (55 loc) · 1.55 KB
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
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "This script requires product parameter: ps55, ps56, ps57, ps80, pxc56, or pxc57 !"
echo "Usage: ./client_check.sh <prod>"
exit 1
fi
if [ "$1" = "ps55" ]; then
deb_version="-5.5"
rpm_version="-55"
elif [ "$1" = "ps56" ]; then
deb_version="-5.6"
rpm_version="-56"
elif [ "$1" = "ps57" ]; then
deb_version="-5.7"
rpm_version="-57"
elif [ "$1" = "ps80" ]; then
deb_version=""
rpm_version=""
elif [ "$1" = "pxc56" ]; then
deb_version="-5.6"
rpm_version="-56"
elif [ "$1" = "pxc57" ]; then
deb_version="-5.7"
rpm_version="-57"
else
echo "Invalid product selected"
exit 1
fi
product=$1
log="/tmp/${product}_client_check.log"
echo -n > "${log}"
if [ -f /etc/redhat-release ]; then
if [ "${product}" = "ps55" -o "${product}" = "ps56" -o "${product}" = "ps57" ]; then
yum install -y Percona-Server-client${rpm_version}
elif [ "${product}" = "ps80" ]; then
yum install -y percona-server-client${rpm_version}
elif [ "${product}" = "pxc56" -o "${product}" = "pxc57" ]; then
yum install -y Percona-XtraDB-Cluster-client-${rpm_version}
else
echo "client version is incorrect"
exit 1
fi
else
if [ "${product}" = "ps55" -o "${product}" = "ps56" -o "${product}" = "ps57" -o "${product}" = "ps80" ]; then
apt-get install -y percona-server-client${deb_version}
elif [ "${product}" = "pxc56" -o "${product}" = "pxc57" ]; then
apt-get install -y percona-xtradb-cluster-client${deb_version}
else
echo "client version is incorrect"
exit 1
fi
fi
mysql --help
echo $?