-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathunaim.sh
More file actions
executable file
·66 lines (61 loc) · 1.6 KB
/
unaim.sh
File metadata and controls
executable file
·66 lines (61 loc) · 1.6 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
62
63
64
65
66
USAGE="
Options:
================
v: The version of MySQL either eg:5.6.31 or 5.6.34 or 5.7.18
p: The port of MySQL eg: 3306,5678
Examples:
================
Install MySQL 5.7.18 on port 57180
$0 -v 5.7.18 -p 57180
Install MySQL 5.6.31 on port 3306
$0 -v 5.6.31 -p 3306
"
if [ $# -lt 4 ]
then
echo "$USAGE"
exit
fi
while getopts "v:p:hg" opt; do
case $opt in
g)
SKIPBINLOG=true
echo "gtid is on"
;;
h)
echo "$USAGE"
exit 0
;;
p)
PORT="${OPTARG}"
;;
v)
# if [ $OPTARG == "5.6.31" ] || [ $OPTARG == "5.6.34" ] || [ $OPTARG == "5.7.18" ] || [ $OPTARG == "5.6.35" ];
# then
ver=$OPTARG
# else
# echo "Invalid -v option, please run again with either '-v 5.6.31' or '-v 5.6.31',or '-v 5.7.18'"
# exit 1
# fi
;;
\?)
echo "Invalid option: -$OPTARG" >&2
echo $"$USAGE"
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
echo $"$USAGE"
exit 1
;;
esac
done
. ./etc/config
$BASEDIR/bin/mysqladmin -u root -p$MySQL_Pass shutdown -S ${DATADIR}/mysql.sock
sleep 20
rm -rf ${DATADIR}
rm -rf ${LOGDIR}
rm -rf ${TMPDIR}
rm -rf ${PRE_DATADIR}/my_${PORT}.cnf ${BASEDIR}/start_${PORT}.sh ${BASEDIR}/stop_${PORT}.sh
cp /etc/security/limits.conf.aimbk /etc/security/limits.conf
#cp /etc/profile.aimbk /etc/profile
rm -rf /etc/security/limits.conf.aimbk /etc/profile.aimbk