-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_db_all_servers.sh
More file actions
executable file
·135 lines (121 loc) · 3.27 KB
/
update_db_all_servers.sh
File metadata and controls
executable file
·135 lines (121 loc) · 3.27 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/bash
source global.sh
posY=0
menu_size=5
print_str="error"
function ExecuteApi() {
stty sane
clear
if [ "$posY" -eq 0 ]
then
echo "(x) INTEGER";
elif [ "$posY" -eq 1 ]
then
echo "(x) VARCHAR(4)";
elif [ "$posY" -eq 2 ]
then
echo "(x) VARCHAR(16)";
elif [ "$posY" -eq 3 ]
then
echo "(x) VARCHAR(32)";
elif [ "$posY" -eq 4 ]
then
echo "(x) VARCHAR(64)";
elif [ "$posY" -eq 5 ]
then
echo "(x) VARCHAR(128)";
else
echo "error";
EndScript
fi
read -p "variable_name: " var_name
print_str="$posY"
print_str+=" $var_name"
echo "$print_str"
echo "[EXECUTING] rcon_api_alter_table $print_str";
# Only one server needed because they share one db
exp_rcon_api/update_exp_db.exp $EC_BLMAPCHILL_PASS $EC_BLMAPCHILL_PORT "$print_str"
echo "===================";
echo "done."
EndScript
}
function EndScript() {
stty sane
exit
}
function menu() {
while true;
do
stty -icanon time 0 min 0
read -s input
stty sane
if [ "$input" = "w" ] && [ "$posY" -gt 0 ]; then
posY=$((posY - 1))
elif [ "$input" = "s" ] && [ "$posY" -lt "$menu_size" ]; then
posY=$((posY + 1))
elif [ "$input" = "q" ]; then
EndScript
elif [ "$input" = "e" ]; then
ExecuteApi
fi
clear
echo "============= ddpp++ alter sql table ==============";
echo "only touch this script if you know what you do";
echo "press (q) to quit and (e) so select";
echo "(w) and (s) to move selection marker";
echo "===================================================";
if [ "$posY" -eq 0 ]
then
echo "(x) INTEGER";
echo "( ) VARCHAR(4)";
echo "( ) VARCHAR(16)";
echo "( ) VARCHAR(32)";
echo "( ) VARCHAR(64)";
echo "( ) VARCHAR(128)";
elif [ "$posY" -eq 1 ]
then
echo "( ) INTEGER";
echo "(x) VARCHAR(4)";
echo "( ) VARCHAR(16)";
echo "( ) VARCHAR(32)";
echo "( ) VARCHAR(64)";
echo "( ) VARCHAR(128)";
elif [ "$posY" -eq 2 ]
then
echo "( ) INTEGER";
echo "( ) VARCHAR(4)";
echo "(x) VARCHAR(16)";
echo "( ) VARCHAR(32)";
echo "( ) VARCHAR(64)";
echo "( ) VARCHAR(128)";
elif [ "$posY" -eq 3 ]
then
echo "( ) INTEGER";
echo "( ) VARCHAR(4)";
echo "( ) VARCHAR(16)";
echo "(x) VARCHAR(32)";
echo "( ) VARCHAR(64)";
echo "( ) VARCHAR(128)";
elif [ "$posY" -eq 4 ]
then
echo "( ) INTEGER";
echo "( ) VARCHAR(4)";
echo "( ) VARCHAR(16)";
echo "( ) VARCHAR(32)";
echo "(x) VARCHAR(64)";
echo "( ) VARCHAR(128)";
elif [ "$posY" -eq 5 ]
then
echo "( ) INTEGER";
echo "( ) VARCHAR(4)";
echo "( ) VARCHAR(16)";
echo "( ) VARCHAR(32)";
echo "( ) VARCHAR(64)";
echo "(x) VARCHAR(128)";
else
echo "error";
EndScript
fi
done
}
menu