|
楼主 |
发表于 2022-7-29 17:20:43
|
显示全部楼层
- wget -c https://raw.githubusercontent.com/mangostwo/server/master/linux/getmangos.sh && bash getmangos.sh
复制代码- #!/bin/bash7 a+ Z1 h& F7 |% K8 h2 J; [
- ###############################################################################6 |- c& t) ?1 K/ p
- # MaNGOS Build Automation Script #
; J5 V* k7 ^- e8 X6 v1 R5 w, K - # Written By: Ryan Ashley #0 H; P3 @& M5 ~6 O7 _9 m
- # Updated By: Cedric Servais #
" d& F9 u X' v - # Copyright (C) 2014-2022 MaNGOS https://getmangos.eu/ #
; n& V* v* n7 f! N - # #' |" c& A5 ~2 _0 W W! u1 G7 U
- # This program is free software; you can redistribute it and/or modify #4 A& g7 ~3 @% p: N. g0 b# q
- # it under the terms of the GNU General Public License as published by #
/ U" T8 b( _/ E8 H5 D; E! S - # the Free Software Foundation; either version 2 of the License, or #
! ^9 i* B- p1 l - # (at your option) any later version. #
. v7 |1 ]$ c4 _. A - # #
; H+ u2 x$ J9 T# b* \/ H; I - # This program is distributed in the hope that it will be useful, #
4 i3 _$ Z! Y3 e k3 Y! i- L# e - # but WITHOUT ANY WARRANTY; without even the implied warranty of #
) z' u4 V' L( S3 b. O* I2 C - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
% \: o" r( v: [2 {( e( T - # GNU General Public License for more details. #
2 l9 s( @" c2 ]' P) [$ z1 X - # #
8 p9 {- p1 H P* b) W - # You should have received a copy of the GNU General Public License #
& X% I, e& f+ V" v, U - # along with this program; if not, write to the Free Software #
8 [6 W8 A* J- n& V. n1 D - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #' ^3 Z3 `0 _9 q, I' y4 m
- ###############################################################################
0 e% V- C' W# m - . y$ c1 i/ ?. ?
- # Global variables
/ [' V! j) O3 l" f: t s' c3 ]" [8 N - DLGAPP="whiptail"; ?2 w, L: u1 j. f0 S
- VERSION="2"
3 E: o7 B) J2 e$ c/ r+ V# _3 h/ Q) f - ROOTPATH="$HOME"
4 v5 r( ]" B3 u3 z - SRCPATH="$HOME/mangos/src"
% l2 r e3 k: Q - INSTPATH="$HOME/mangos"
' @: u: P4 v: F" u% }) [ - DB_PREFIX="two"* G# h" {4 c/ l v
- USER="mangos"/ f f! w0 u; B" K. C9 L+ X
- P_SOAP="0"3 N) \6 U( ^) `+ R* \$ E
- P_DEBUG="0"
* Z+ t. y% P3 C3 @% m - P_STD_MALLOC="1"
3 e; m* d0 V5 q - P_ACE_EXTERNAL="1"# H9 z- F/ T- W% `
- P_PGRESQL="0"
" M' I( |' l) D5 j) ~. \ - P_TOOLS="0"$ N, Y6 \/ p# E* [
- P_SD3="1"
' i3 a- f; j( P. I# T; ]2 g - P_ELUNA="1"* O) g. |8 K, H( e+ Y
- P_BOTS="0"2 v$ w0 M9 z4 O! U- G |
- CMAKE_CMD="cmake"# \/ H: p! G( Q' i: m8 i
- 0 J1 x$ V, P( f: s ~
- ) p: K" `/ x, S1 L
- function UseCmake3()$ I$ ]0 {/ \( i+ I) W; T+ c
- {
$ f# D8 [7 U- X E6 H& L( l% W - # set the command to cmake3 if its there
& ?2 y4 a& C9 z$ B4 m, Z - which cmake3: m2 n8 T0 \% |1 r n0 E& Y
- if [ $? -eq 0 ]; then5 j Y/ J% c! V/ j
- CMAKE_CMD="cmake3"/ h" c) O' `' k5 L4 \1 u
- fi. ~0 T; L$ E5 k6 u2 A' f' E
- }
7 K. \1 R' f/ x% l, r) W. _( u
, `) S1 w# i; b, Z! Y& j- # Function to test for dialog0 O* Z7 R) z B1 ]3 L7 u
- function UseDialog()
; y: r. n9 P, y$ Z - {' \2 r; X. s. x0 t
- # Search for dialog# P$ [' k6 ^/ B- h& K% l; A# T+ X* b
- which dialog
) k+ G: A7 E% P3 R1 | - " D! i, X5 y( u
- # See if dialog was found
8 K- l' S. O# x" G: X - if [ $? -eq 0 ]; then
+ U+ p+ v8 x$ U* f9 }% R# C7 h" ^ - DLGAPP="dialog"4 k( ]* a ^4 S: _8 |* X- q+ \+ p
- fi
- n1 G6 V5 E: |2 N - }
( M, Y R$ L" U. |. S! n
& Z) @% f7 X1 e/ V- # Function to test if the user is root or not
; z( Z) T3 Y9 d" H1 S- d8 z - function CheckRoot()
: f) A+ S& [( O& c - {, r/ j! U9 E" b, O9 K+ V w
- if [ "$(id -u)" != "0" ]; then
6 D5 z5 y5 E+ l4 ~$ b - Log "This script can only be used as root!" 1* v0 r+ A& s d/ v4 d: Q
- exit 1 s. T9 X* D8 x" B7 y) ^- g
- else9 O! U3 N; g. ]3 y5 x: o
- Log "User is root, check passed" 0
3 i; b# I& z6 C! P; J - fi
+ }8 k# [2 A1 x9 g O* _ - }2 Y+ s5 }7 D) O9 f
[8 M( x5 k4 I* v) j- # Function to detect the repos5 h! L7 a5 f# I4 P( o. ~. `. t6 M
- function DetectLocalRepo()% y3 k8 P% U" e8 n
- {3 k) q+ e1 Z9 e& O
- local CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"7 W9 }# f6 c- P3 d! c5 x( M: t* m
- + C* M0 `+ u$ i6 Z& V
- # First see if the Windows stuff is in place
/ l3 t: z4 n7 X8 A5 k, ? - if [ ! -d ../win ]; then
6 ^- ?7 q8 L& p5 l" F& s6 G - Log "Windows files directory does not exist, assuming repo has not been cloned." 0- A. `( g$ Q2 g
- return 0
$ o' L$ R" N# v( c) [0 L2 @9 k - fi
# z% ?9 f. L+ S4 Q - 7 |, P& ?" @0 [, W
- # See if the sources dircetory exists# y* k7 L" t4 M: B' |4 n
- if [ ! -d ../src ]; then
' @2 v$ `; ] @9 w6 y' ? - Log "Source files directory does not exist, assuming repo has not been cloned." 0. W7 g5 O/ Z0 e* ?8 g
- return 0
5 R- e9 Z7 G9 z! i - fi2 F! \+ R: A3 J. o0 E+ r/ a
- , u3 B5 E' s8 J; v6 v& S
- # Check for the CMake directory
/ w/ }% z* V* X6 T, n - if [ ! -d ../cmake ]; then
7 J$ S% D6 c) {$ S9 X - Log "CMake directory does not exist, assuming repo has not been cloned." 0
, @) C/ i, k# T, K, H) x) S - return 06 f) I+ s4 j& v6 Y% ]
- fi
/ i7 F8 b7 D n1 k2 v4 t
8 H; W. p0 K# K6 c$ p- # Set the default paths based on the current location6 l7 x3 i3 {# A1 x9 F) i, f
- SRCPATH=$( dirname $CUR_DIR ) B3 b: { h ? Q9 g4 m9 K4 w2 }
- SRCPATH=$( dirname $SRCPATH ): q$ J6 V. y. l* _9 ?$ M3 l
- ^- _. S2 U) K0 Z- # Log the detected path
! n, ~. h2 ?# i# A" @" Z2 y U - Log "Detected cloned repository in $SRCPATH" 03 [* X4 j, J9 |8 |
- }. Z4 m! z9 Z1 w2 G) G! j: ^
7 L+ N6 G5 T* n# P$ w5 A0 Y& K+ q- , z' z3 T9 V- z% o7 Q+ }4 U0 {
- 8 C1 |% i: m$ R. W5 G
- # Function to log results
( Z5 {$ S" }; `: l7 O1 u - function Log()5 f6 n8 O( g- R! p- O
- {0 ]( m: m# U1 j- p2 |) B
- local TIMESTAMP=$( date +%Y-%m-%d:%H:%M:%S )0 C0 R3 l; f2 q3 F2 e$ V
- 5 G1 Y* I+ q$ o$ H3 W
- # Check the number of parameters: ]7 q Z5 y# X. {# K% c7 s) ]
- if [ $# -ne 2 ]; then+ P. _9 n* s) `- s9 o
- echo "Logging usage: Log <message> <echo flag>"
& D) E- X' i# o( p8 I. Q - return 1
1 P o2 N$ D5 @9 q - fi
- p. ?6 q. U; z - , m. p J, J3 S- x% u
- # Echo to the console if requested, d2 L% C4 [# E9 R
- if [ $2 -eq 1 ]; then8 [- w9 A& @2 r. o
- echo "$1"
6 ~6 L0 T5 y* u5 C5 H$ Q( ~ - fi
9 @( ^: J" N& d+ B: F3 ?+ X+ q - 0 k5 Z) H2 v/ _& Y, c
- # Append the string to the log
8 N( i+ W r% R1 m% k - echo "$TIMESTAMP $1" >> ~/getmangos.log& x0 l6 }$ [) m. e0 t
- }& K$ E; u& g N2 s' \, g/ d
- ! Y% q" }6 i0 r! o1 H# s; R
- , d6 u$ _5 ^2 |; V# m J& m" w% G, T
- * D! {6 O2 ]% B2 g0 p
- # Function to install prerequisite libraries9 v7 [" {! o& ]/ \/ n( J
- function GetPrerequisites()
. h. {6 i+ X4 b7 ]7 f, K) m5 K* b0 h - {
* T% n, ]2 s, p* c% V+ h: C" s - # First, we need to check the installer.
" D5 {2 a% b* d - installer=0
- ^8 w+ N4 E; y/ w5 R! [, K9 F - ' x, A- w: t: s2 r9 D
- which apt-get
+ p" Y8 @" b4 B+ a
) H6 J5 f0 T& V5 ~6 P, @: D- if [ $? -ne 0 ]; then
: E9 b" `5 g+ B! N( b F7 X# D7 X - Log "apt-get isn't the installer by default" 15 X( a6 O7 k% h/ D4 I3 D' c
- else
+ ~, `. M) A: [+ ^9 I2 M4 N2 p1 V - installer=10 Q( E+ m3 N. y" q
- # On a fresh OS boot (EC2) libace was not found without first updating / a& A6 S! V1 e' K
- apt-get update -y && apt-get -y install git lsb-release curl
$ H: b* y3 U5 i6 t# P2 t, W, s - fi1 ^. S, I1 M. U4 {; j7 Q9 M
9 T# D6 L& L, g5 E! P4 v+ q- which yum+ f7 d( s' I/ L- M" x' y
+ B0 I$ z ]& c8 d6 M4 N' z- if [ $? -ne 0 ]; then
3 }- d% a5 X% s' ?9 x, l: f* U - Log "yum isn't the installer by default" 1
: H6 D' K! H2 e3 ~) d' c - else
3 I5 F5 l- A8 c( ^5 A - installer=1
. r8 ~- X3 D2 O1 | - yum -y install git redhat-lsb curl: t! p( L# Y/ {5 k# i1 g! y
- fi
9 H" R b' j2 B$ n/ g w
% Z& N |& [, e+ H4 t7 Q- which aptitude/ I: @# [. T$ x9 B
- if [ $? -ne 0 ]; then/ v( g! r6 V) U3 a4 }/ n
- Log "aptitude isn't the installer by default" 1
# Z5 b) H, e( c. z - else, d: V! }& n, q# x+ P2 U
- installer=1
& s% t7 P% v* m c7 l Q4 y9 p - aptitude -y install git lsb-release curl
2 e; y- x# f0 [/ u7 I Z' J - fi9 ^( `. E4 g3 T. h8 Z$ V/ G- X1 N
@5 r& H5 R% x3 n7 t/ b- # Then, let's check that we have the necessary tools to define the OS version.7 o3 H: k% M2 ^9 n3 s( _
- which lsb_release
) P9 T. \' x! G" `: x - & \. N6 ^7 s$ P8 H) r& z6 B
- if [ $? -ne 0 ]; then/ n: u2 A+ a, ~/ a9 ^/ F3 c# I
- Log "Cannot define your OS distribution and version." 1
3 V8 V8 X+ t9 l. t- Q6 Z9 i - return 0
& V3 ~% N+ L# x - fi
7 J; F0 d% I; z2 a) Q - 1 i; r7 p' I2 N
- local OS=$(lsb_release -si)
; v3 V/ V9 a1 a6 o0 T8 ?& ?6 S" D9 V - local VER=$(lsb_release -sc)
: w) g/ l g# g; k4 l - local OS_VER=1
; }5 y$ Y0 G7 X/ Y - . N7 N# C! g1 @- M/ g: C9 s. E
- # Ask the user to continue! ?/ Z5 V. X. j6 Y9 O
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Install Required Dependencies" \0 k9 A. u9 A/ R' H/ r
- --yesno "Would you like to install the required build and development packages?" 8 609 {% L0 x4 n3 L! A
3 p' x- g2 `" l) U1 Z0 l& l- # Check the user's response" q) x* G( S$ O2 s( x% I4 R, |6 S
- if [ $? -ne 0 ]; then
4 d" z2 [3 s8 }2 [1 K8 ~2 b - Log "User declined to install required tools and development libraries." 1
0 x0 Y8 C- a+ R1 ?8 z - return 0
0 d, G5 S3 L( C3 _; ~" A+ G - fi
7 R! p5 W- h. k' j - $ @4 h7 g% T# k9 J- r' r! j4 @, k2 M
- # Inform the user of the need for root access
% a+ U9 D2 E2 H& y+ U - $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Install Required Dependencies" \! s1 A) ^6 }, r3 m
- --yesno "Installing packages requires root access, which you will be prompted for.\nDo you want to proceed?" 8 60
) [, G8 T, m; z: S8 X - ' G* H3 s- r) e
- # Check the user's response
2 M- {- U1 K+ n' Q - if [ $? -ne 0 ]; then
- {/ J5 E! ?+ j$ j - Log "User declined to proved root access for package installation." 1( o# P. r8 g2 t7 A1 r4 j- C% u' J
- return 06 f7 y, s u1 W4 j3 o% `
- fi9 U& l+ L, ?$ ^8 s
- b6 {9 K& P/ V' C) X! W ~- # Handle OS: D, ~' ~8 Y" z4 o# Y% V( i/ B
- case ${OS} in/ K" y3 ~( T5 B* S
- "LinuxMint")
{7 q$ W% Z4 M0 A - case ${VER} in
* \2 Y' U, f( l- N) V2 e - "sarah")7 Z; ` F+ t% l# {( o+ ~
- # Linux Mint 18 - Ubuntu Xenial based7 {) L) [3 b7 [" I0 _3 J( o
- su -c "aptitude -y install build-essential cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev" root: E) z5 M( n1 J" B: B( G D( j0 O
- ;;, ^4 ]7 y* i6 I1 S9 i
- "rosa"): c% N5 \3 ?; l3 D6 B* g! q* R2 j3 h
- # Linux Mint 17.3 - Ubuntu Trusty based
- J7 Q0 ?% I0 k1 E$ a" c - su -c "aptitude -y install build-essential cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev" root2 k7 w8 m* H. G O O
- ;;
% J* F( X4 k9 L: e* b; Z! g - "rafaela"), Y, v9 j5 Q% h/ J1 l# t
- # Linux Mint 17.2 - Ubuntu Trusty based
8 \; f$ Y* s3 Z - su -c "aptitude -y install build-essential cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev" root
4 @% q$ m% p s4 h) u% w - ;;
+ z4 K- B' C" o - "rebecca")7 p! {, @& U8 T c: F O5 ^% f/ A( _9 l
- # Linux Mint 17.1 - Ubuntu Trusty based( \6 t5 W, l6 @; z7 g
- su -c "aptitude -y install build-essential cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev" root
2 V+ Y e/ T3 |: I: P0 |( I/ w - ;;9 L3 A3 B8 o, S. _( Z7 @
- "qiana")* L4 U% ]; I0 y& M" C1 @9 F
- # Linux Mint 17 - Ubuntu Trusty based j9 u; g; G& i7 n2 U/ k w' u
- su -c "aptitude -y install build-essential cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev" root
9 A' p1 j3 x% V5 z - ;;
7 H4 `2 I2 o5 M0 t. {- r. o - "maya")( f+ z( U5 ^# }+ J1 F' Y, M6 h
- # Linux Mint 13 - Ubuntu Precise based
' _6 B5 C. F% ^- ~: b - su -c "aptitude -y install build-essential cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev" root" Q' U, J6 [) I! q/ M
- ;; H0 h9 K# Z" h7 b8 y) g
- "betsy")
) B, }+ I% t; r6 T7 ]4 [( x - # LMDE 2 - Debian Jessie based
3 `" B$ x/ P; x: k3 G - su -c "aptitude -y install build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev libace-6.2.8 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
/ @" C3 r" y$ [) ~6 q% b3 a( ~4 i - ;;$ p0 d, n$ w1 {2 g
- *)
" O$ g* b# [; [' K! U1 | - OS_VER=09 s" S% z3 n5 O( Q
- ;;* C0 |. D0 o3 h1 u3 ]
- esac7 K2 g( q1 o) M) ^
- ;;
0 c& @' a9 `: [# l* d - "Ubuntu"): A( O0 R+ W) D, c G
- case ${VER} in. c; e$ a* S+ q- O* r: y( b# o
- "precise")
& p5 C1 d O- v* t. \* r - # Ubuntu 12.04 LTS
' y0 b% d0 l! V1 N( ^1 p - su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root
0 D# D, I. ?: T9 C - ;;
& a" n4 t, r4 u6 R5 c: k - "trusty")/ j* V* ?. {! K, Q
- # Ubuntu 14.04 LTS* W9 K& N/ x* t/ Q5 ?
- su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root
M9 v0 K7 P- `. p" \ - ;;1 g8 |# y6 M* m4 c1 g) _
- "xenial")
4 ]4 B. f$ r$ W$ Q9 S. T - # Ubuntu 16.04 LTS
; Q7 L9 {; g7 d& M - su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root
4 Q/ B* \/ A" z( v. ] - ;;7 ?5 v: r d/ d3 z1 ]3 l5 Z8 P6 z
- "yakkety")& `; y' ]4 l4 l' h: X% Q; B
- # Ubuntu 16.10
; C. Y. ?3 Y' _4 X5 n - su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root
8 S& j* N* N' `; h. R( H/ ?5 X: E; x - ;;
4 n. P- b4 K4 S' I v - "zesty")
- S* i, k( j0 U5 s$ [6 \* t" O% h - # Ubuntu 17.049 u- B, `( x8 i# m4 L, s! J
- su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root( Y. Q0 F) R5 g/ S; S! o* w
- ;;
$ t& J: O. U# y* x6 a - "artful")
9 T q, _; |' i) C, { - # Ubuntu 17.10% G$ T& e/ [& [$ s
- su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root
2 K: C7 H' n* Z/ E - ;;$ a+ z. k! N2 K! \
- "bionic")
; Q9 P9 ^' w" l4 E2 ?+ }7 b9 q) @' ~% q - # Ubuntu 18.04 LTS3 |+ T$ I' L0 l5 f1 G
- su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root
5 W5 N3 x* Z* ^. C" a - ;;
; R7 Q* d7 ~" v - "disco")
3 y7 q4 G0 x; o* v" Y! j - # Ubuntu 19.04
6 {9 d$ p; t/ ~' P$ Y# |; N - su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root5 A+ n7 ^, e \" a# L. x [
- ;;% z9 y- F0 f/ F! B9 S8 P3 f, S
- "focal")
) j' T& s: H2 g, l1 Q) H; G - # Ubuntu 20.04# U2 |1 V! ?* `
- su -c "apt-get -y install build-essential curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool" root+ o- [" ~" ?' G
- ;;1 Q4 D- G. l8 l
- *)
( {' c7 O1 m7 z, t4 L$ J) s - OS_VER=0
/ S7 X) D0 i$ I3 [1 k) C - ;;9 ]' G2 f8 C1 F0 v/ v
- esac
2 C( N& ]" Q8 t5 N8 Y; w7 F, \ - ;;
& c1 h) _# l3 V t7 o, ^8 _. p - "Debian")" `: M3 N2 T# }5 B' w+ x% P* P: E
- case ${VER} in$ B; M8 g8 Y9 K! R9 L! L" I
- "jessie")
0 Z4 ^1 A2 N- q% u - # Debian 8.0 "current"
7 n o+ F) y5 ]: w L - su -c "aptitude -y install curl build-essential autoconf automake cmake libbz2-dev libace-dev libssl-dev default-libmysqlclient-dev libtool" root; ^" Z9 _4 r) s$ L' @
- ;;
/ X/ b# ^; Y2 L o5 { - "stretch"). }; v* z+ O- R/ m7 z
- # Debian Next7 j$ H l# l6 Y2 ^
- su -c "aptitude -y install curl build-essential autoconf automake cmake libbz2-dev libace-dev libssl-dev default-libmysqlclient-dev libtool" root
1 t7 ~6 O+ R7 O" Z. M - ;;1 X& M9 D7 r' Q& Z+ j
- *)& k, t5 x6 T; H) e6 t; `
- OS_VER=0
4 |7 V* N8 z* O- |8 f - ;;
6 C1 Q: X: u/ [: u - esac; F/ ?, V) B! J1 J( `/ X
- ;;
& \, R8 ]/ K2 A% I% M - "RedHatEntrepriseServer")4 Q5 F( j7 N* o
- case ${VER} in
. N2 G0 {/ y0 r- C$ A8 E - "santiago")# m$ x: e" ?2 Q6 X3 y3 p
- # Red Hat 6.x8 t/ ]0 |6 k+ Y" _# j. n& m8 t8 N& H
- su -c "yum -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev ace-6.3.3 libssl-dev libmysqlclient-dev libtool zliblg-dev" root
8 N. I+ c' a+ Q C2 u1 e - ;;3 `" ]8 v! e- ?: T* s7 [# i& r
- "maipo")
! V# o4 g8 y' L( ^" U+ T - # Red Hat 7.x
* K. [( U/ |0 S( ^& `6 t) e - su -c "yum -y install curl build-essential linux-headers-$(uname -r) autoconf automake cmake libbz2-dev libace-dev ace-6.3.3 libssl-dev libmysqlclient-dev libtool zliblg-dev" root! G* \0 N# X8 X ~' ?( ]
- ;;
, K# [5 G+ G' c$ _9 x, b9 E - *)/ c6 K5 P; V' _9 p l
- OS_VER=0$ H ?& d1 I0 K5 R
- ;;
& X R' C3 g9 p& x4 H/ I - esac Y1 v& G( F$ Y/ Q+ p
- ;;, c$ I2 z& a, Q
- "CentOS")
8 i) B6 Q' M* ]5 j9 b2 Q - case ${VER} in, P* U( `- V' w4 N; X
- "Core")
+ d- R' Y* S/ D) I" W. s$ |: v3 N - # Default CentOS - Adding necessary RPM third-party.
. T- c3 S2 Y# d v - rpm -Uv ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/devel:/libraries:/ACE:/micro/CentOS_7/x86_64/ace-6.3.3-55.1.x86_64.rpm
; [* k; n, M2 u5 x/ s. ~+ E - rpm -Uv ftp://rpmfind.net/linux/centos/7/os/x86_64/Packages/perl-Net-Telnet-3.03-19.el7.noarch.rpm
L2 i3 n4 s! ^ - rpm -Uv ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/devel:/libraries:/ACE:/micro:/versioned/CentOS_7/x86_64/mpc-6.3.3-42.1.x86_64.rpm
8 S! p: S. b8 I" {% e; o - rpm -Uv ftp://rpmfind.net/linux/centos/7/os/x86_64/Packages/libtool-2.4.2-22.el7_3.x86_64.rpm
% v3 U, T6 E. u2 | U - rpm -Uv ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/devel:/libraries:/ACE:/micro/CentOS_7/x86_64/ace-devel-6.3.3-55.1.x86_64.rpm
6 l; Y0 _/ b% h) C5 k - su -c "yum -y install epel-release"/ A& x) g1 n Q) g6 M. z
- su -c "yum -y install curl autoconf automake cmake3 ace-devel ace-6.3.3 openssl-devel mysql-devel libtool gcc-c++ bzip2-devel" root
( r0 r! _* `8 D( k - ;;; i; Y' D( [3 ]: U
- *)' v) i! a F7 M
- OS_VER=0
) L1 B% ?/ w6 ~ - ;;# E1 G- u5 z t$ T, Z* R4 `9 b
- esac
1 b0 K W! e6 k/ w. t) C - ;;
D0 h! n* f9 Z% Q% w o6 b+ L - "Fedora")- f! J- m# |) U4 J; T
- case ${VER} in- X( n& J7 @) t0 x3 c! z
- "TwentyFive")
2 s/ P- _: ?, e1 M& d - # Fedora 25 - Adding necessary RPM third-party.% b# K0 M% q: a! P7 M5 @/ i
- su -c "yum -y install autoconf automake libtool gcc-c++" root( K- c; n# c7 Q; [& f
- # Getting and building ACE. Not provided in RPM for Fedora.... ?$ [1 B/ l# A
- rm -rf ACE-6.3.3.tar.bz2" W C5 f0 z' }' M1 E
- rm -rf ACE_wrappers9 x$ |/ x5 t( { @8 J1 B8 b, k
- wget ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.3.3.tar.bz2; T& o8 w5 Y! z2 t1 p. C# l
- tar xjvf ACE-6.3.3.tar.bz2 _: O! [+ z3 C' h; [- I
- export ACE_ROOT=/root/ACE_wrappers
* z/ ?( S- w1 E3 W - echo '#include "ace/config-linux.h"' >> $ACE_ROOT/ace/config.h- \2 U$ P6 d4 w+ H* a
- echo 'include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU' >> $ACE_ROOT/include/makeinclude/platform_macros.GNU
2 D8 y3 E. k$ i) V, m - echo 'INSTALL_PREFIX=/usr/local' >> $ACE_ROOT/include/makeinclude/platform_macros.GNU
. d4 B! D, ?6 i0 n/ F- `# e0 F" o - export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH
9 U5 f; c7 A* P/ ^# b' c/ p - CD $ACE_ROOT
2 D3 U/ K0 T5 n8 w7 @) | - make& D* I( @4 Q" \( L
- make install; M2 }/ M& C9 V. k( V+ v
- cd ~ z8 r# _ u, V2 J
- # Installing remaining dependencies..% j) p) z/ k2 ~4 ]3 Y: _0 @
- su -c "yum -y install cmake openssl-devel mariadb-devel" root
* q! i5 A* K: j5 } - ;;# G3 }1 [, n2 e5 e. v/ p- N! |( E6 V
- *)
/ J7 ]- Y' ]: H7 [) g; a3 C - OS_VER=0* ?7 v' [5 J! J( R# h, @
- ;;) r) k7 ^* z7 d0 t! G. _) A
- esac1 c T, k. K7 |( @. N
- ;;) Q9 L) H4 h& S
- *)% `- D7 F: }; V2 H$ L. m9 k/ t
- OS_VER=0- S8 ?) U9 u8 l+ }4 A
- ;;& Q* n# q" g6 T) \
- esac
9 L/ Z$ }8 x+ Z& {3 j. F
( c1 [3 I# @! @/ d& ^- # See if a supported OS was detected0 p+ M: g0 I [- o
- if [ ${OS_VER} -ne 0 ]; then* p# K* r( _8 y N; x
- # Log success
1 T, O3 R- k2 D% ~ - Log "The development tools and libraries have been installed!" 1
& ` y! {+ B$ m" ?2 z - else& R' a+ A1 O% s2 c
- # Note the error
" b" K. q) }% i( ~5 U6 g5 j - Log "Could not identify the current OS. Nothing was installed." 1
. B; O5 c+ A; H1 _! m! u$ Y - fi, ?! v3 ~% v; ^' D2 |0 i0 W
- }
5 x( P' Q6 ^+ [2 R! h5 P: c
$ w, N( x) ?/ k9 h2 ^- X) d- ( e1 w2 d3 x6 c) n
1 n. z l, }$ |! q- y# z6 a- # Function to get the WoW version! X" K; J3 p# y6 Z8 e4 f
- function GetRelease()
% O; U3 a* V4 f+ V) Y' ^. b3 C - {4 x) ]. H. f- y# c+ T
- VERSION=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Choose WoW Release" \
2 S* A, X; C! U* ? - --menu "Select a version of WoW" 0 0 5 \, z* g& `$ k& l
- 0 "Original Release (Vanilla)" \# M. N, f. B( g2 Q
- 1 "The Burning Crusade" \
0 P N8 V R! t1 U; n, x - 2 "Wrath of The Lich King" \8 F. R( Q0 R9 ?, c
- 3 "Cataclysm" \
- [' |5 i8 d! `$ w) x - 4 "Mists of Pandaria" \8 N: e7 u% h: l' k
- 5 "Warlords of Draenor" \/ }" s$ L' k& B- `* ^2 U: Y8 \6 Z
- 3>&2 2>&1 1>&3) Z& s, L+ h! r4 \6 S
8 c# ?1 f3 h A# v7 E) v4 Q- # Exit if cancelled: b/ \" p3 I; {/ `3 I* ^
- if [ $? -ne 0 ]; then; s9 I6 |' B, I% \
- Log "Version selection cancelled by user. No changes have been made to your system." 1* p# {5 T4 u+ s! K- v! B! J
- exit 0
7 A/ `9 N0 C p; K - fi
: I! L5 N! k G4 E0 n2 R6 L* {8 l - 8 p# W- c5 c* t7 R- E8 _% [
- # Set some defaults based on the release- W% w" V& u+ M* Q8 H
- case "$VERSION" in# z+ \2 l5 B/ [0 t! q! l$ u" U! \5 y
- 0)# S# K+ S2 v4 |8 e7 s- f
- SRCPATH="$ROOTPATH/zero/src"& c$ w/ T3 H+ s7 W0 S; r
- INSTPATH="$ROOTPATH/zero"' E# W' B8 h' D9 B0 P
- DB_PREFIX="zero"- ]0 g. S" m5 [7 e' ^/ j8 p- E9 P) ?$ f
- ;;
2 k2 M( \4 m, @# |4 B' V3 @
9 G, d% I4 G" v/ x! d7 H- 1)8 l1 e0 U- O Q9 A% t7 X
- SRCPATH="$ROOTPATH/one/src"
" Y o% D% V% w) [ t; n - INSTPATH="$ROOTPATH/one"/ W) u- {5 n7 p( o" y
- DB_PREFIX="one"
) x/ A1 e/ M6 t: P7 G4 W( P: j - ;;* `6 j( b$ N- M+ n# D
- 8 n7 E& [& z7 g* z/ c. ~
- 2)
; y( B6 c5 |5 y! R! X - SRCPATH="$ROOTPATH/two/src"
4 ^# f! f' C" `$ ? _1 k4 E - INSTPATH="$ROOTPATH/two"3 P3 f3 |0 }2 h/ S8 }! u7 \
- DB_PREFIX="two"
4 a' Y+ i8 ^" J/ H - ;;
0 F( m9 B( _9 ^. n9 h5 S7 U
* w4 d; q+ p. T6 c/ O1 Z' ~- 3)
( e7 D5 R3 O/ O# y' }+ d - SRCPATH="$ROOTPATH/three/src"
# c. ^3 ?& A* X3 N) R5 n - INSTPATH="$ROOTPATH/three", v+ T, u- k4 b3 ^+ R% ]9 a8 q
- DB_PREFIX="three"- v u3 {, P, C* _/ `2 ]
- ;;
: D' u3 r. _7 G% W1 L. o: `
9 _" n9 E7 ?4 ?. }( e- 4): g% K! d' \0 I6 L5 D
- SRCPATH="$ROOTPATH/four/src"
9 S* ~* B6 i) B- W! U* Q5 P' U+ O. k - INSTPATH="$ROOTPATH/four"
5 j. V T) H5 s; W3 R - DB_PREFIX="four"
2 r& `4 x0 Q, p) k# f: N2 g9 h - ;;
9 [5 t& A# M, C) N! v! O - 5); t6 o; x- c( N& E' ?
- SRCPATH="$ROOTPATH/five/src"
% _$ V, Y2 I6 b - INSTPATH="$ROOTPATH/five"
6 O0 e6 M2 u0 F% q: f - DB_PREFIX="five": T8 `% n- ?/ s5 e" F3 j
- ;;) W# o& \! c' n; t' S9 K
- *)( n, ]+ F. j6 z+ \5 a- ?
- Log "Error: Unknown version selected!" 10 [$ [3 M1 z+ H8 i
- exit 1) @/ y2 t* K. z: |- P; [
- ;;
. t" ^, ~+ ?! E+ C! z - esac1 o' D- l( V" {- P1 b4 ~, W
?8 Q! W7 |0 Q4 f# o& W- # Now set the correct source path if the repo has been cloned already
1 _6 l* }2 T( v - DetectLocalRepo, Y2 ]6 P {5 B& I8 H$ Z4 {9 h5 L
- }" N2 q, M: N) o" p5 |5 [
% j9 d' c) i$ x2 w" g- # Function to setup the technical user, W2 ?' D3 D0 v9 @; {
- function GetUser()
- [$ `. @& Q! o0 U5 R - {3 K# t. `3 j0 }1 z5 B, S6 [
- local TMPUSER="$USER"1 _8 G5 l/ M- w* W" Z- v* N
- - R% e3 U/ j; b# h9 G
- # Set the user
0 O' P* q* l) J& B - TMPUSER=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "User to run Mangos" \
& n0 ~% \8 T8 R - --inputbox "Default: $USER" 8 60 3>&2 2>&1 1>&3)
7 u" C2 g# l/ A M! V/ D - W" _0 q* Y2 ]
- # Exit if cancelled
- B5 J5 |+ O' ~8 ^5 t - if [ $? -ne 0 ]; then
0 Q8 Z; q3 j9 a5 e9 b - Log "User selection was cancelled. No changes have been made to your system." 1/ \3 j( f# {; R9 v
- exit 0
& p% Q* P! t7 F$ C. ` - fi
d1 w: v' w2 O q( _ - ( z: U- l, P! L. B6 F, Q! K9 @+ k
- # Change the user only if it was modified
/ d9 Y9 f2 u+ ]( Z' U - if [ ! -z "$TMPUSER" ]; then# F& h% U H! D x/ F, a
- USER="$TMPUSER"
& b/ U- B( C% X% J) z - fi
- [9 K# O7 A7 ` y3 Y
' r; Z" D$ r* B, J; E+ P- # Validate user) L0 f) K8 F Y7 C2 q( c" Q
- id $USER > /dev/null 2>&1- I# f% b$ c1 c+ P; S5 w: Q/ i) A- b$ o
- if [ $? -ne 0 ]; then: v1 t! t n4 d# h' a$ g$ g: B
- Log "Creating user: $USER" 1
& J8 X% R1 F, y& p7 \! U - useradd -m -d /home/$USER $USER > /dev/null 2>&1# [ B" Z- o: `7 x3 a# [
0 `' h( A) P0 c u+ G( l, d5 u- if [ $? -ne 0 ]; then
6 N/ u7 b* |; w" B- U1 T0 `2 Z/ R - Log "Error: Failed to create the specified user!" 1
# S$ i) l2 O, \7 A - exit 1
1 w0 |; {' u9 B8 g+ M- d8 q - fi
: G! _+ J& C( ~4 ` - / c) P! V8 f5 I! z" d) z) P
- usermod -L $USER > /dev/null 2>&1" x/ B7 X: n9 i. _& ]
- else
$ S5 v k! i# n0 w, ]) Y3 E; U - # User already exist, asking to keep the user: B! B+ R- _3 [" q! ~2 H+ ~
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "User already exist" \
3 z4 C; P, E' P; C- D! v& ^ - --yesno "Would you like to keep the user "$USER"?" 8 60* A* d0 n, z7 U( V' k; X0 |
- 6 R! F; Q ]5 C6 w: M2 `$ b
- if [ $? -ne 0 ]; then
1 P' `, n) ~& t: S/ `5 D) t5 Y. ] - Log "Removing user: $USER" 12 m& A: z$ h- K0 Y, K/ C, X
- userdel -r $USER > /dev/null 2>&1
3 [ k6 F" T5 J+ N" h* ?
/ N Z8 l: k1 q. A1 m6 ~1 I' O- Log "Creating user: $USER" 1& z3 G1 B1 ]/ i- }- t3 ]
- useradd -m -d /home/$USER $USER > /dev/null 2>&1
5 K% O; p& |9 \ - ! {8 b7 n+ P6 \6 Z) [1 U
- if [ $? -ne 0 ]; then @0 ]) `! o( a/ c) b
- Log "Error: Failed to create the specified user!" 1
& y% T0 Z% ?# Y' a4 [; C - exit 1
$ C) J; |) h4 Z- y - fi+ b( I" J: _. W' b. R* S/ F
: ~1 ~% C$ e! h! G( U/ k- usermod -L $USER > /dev/null 2>&1
! e$ X( Q6 y7 w/ `4 f: H - fi
% s) C4 g5 m, u/ g# E( A - fi
8 O% x8 b8 n$ T( K - ' J+ S6 d# e7 p0 t% Y3 |
- ROOTPATH="/home/"$USER
: c7 h# N2 }" t0 d3 q" b - Log "User: $USER" 0; l. w$ U8 [: {* r- N+ B3 P
- }
& \3 r8 @: ^5 B# |
. I- Q7 @ B5 K- # Function to get the source and installation paths9 _+ F& S# h- j3 ~/ y1 F! M9 I2 O1 y- w
- function GetPaths()
0 s# s5 \0 }2 U$ D5 t7 T - {
: ~% d+ h& W- w - local TMPPATH="$HOME"* l* }) Q1 ]" b
- 7 U/ @- o `- c9 B2 a9 u2 [1 f
- # Set the source path
) K7 V" {# e' @, X- m - TMPPATH=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Source-Code Path" \
! C5 O2 S9 G- c - --inputbox "Default: $SRCPATH" 8 60 3>&2 2>&1 1>&3)+ t; y/ m0 X' C# G
" t! X7 _+ N' A {8 p0 a S2 D3 y- # Exit if cancelled/ }, a l1 }0 c$ Y
- if [ $? -ne 0 ]; then
5 ]% A6 j) v8 S8 D$ S - Log "Source path selection was cancelled. No changes have been made to your system." 1* k% X% }5 w @) w
- exit 0- z, Y1 l) V% |
- fi
: v! C! o4 w3 ^3 m) n3 \ - 6 X/ X, K, ^+ s! q
- # Change the path only if it was modified
* g8 k! R0 M% m) \# k$ Z' H+ v3 f y6 h - if [ ! -z "$TMPPATH" ]; then
; k V: w1 {% `! Z8 n2 T0 a* t9 }6 X; X - SRCPATH="$TMPPATH"
( x* c3 o- D% E - fi
& ~0 y" ~% s! v
+ [ u0 B+ G* L, e$ k- # Validate source path
" o. S! L% U9 J) i: n6 P - if [ ! -d "$SRCPATH" ]; then- F- E7 o @, o$ b% f! ?9 Y
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Path does not exist" \
- e" Y x$ o" D - --yesno "Would you like to create the directory "$SRCPATH"?" 8 605 R7 B4 `" J7 V E0 ~# _+ o
- ( {) ^! |/ C6 A7 M8 y! s. D+ z
- if [ $? -eq 0 ]; then
7 ~1 }6 Z, m8 H - Log "Creating source path: $SRCPATH" 1, y( g% Z6 C f9 ~ `0 B! |9 n3 i
- mkdir -p "$SRCPATH" > /dev/null 2>&1
' X- X! m% _- a
* n/ u0 H% m& F6 d3 S- X7 D% @2 i- # Check to see if the directory was created# \0 V- ?2 j% i0 _3 \# y1 K; x
- if [ $? -ne 0 ]; then6 s3 p' o# N! d, h6 K. X0 Q% q9 E
- Log "Error: Failed to create the specified source-code directory!" 12 c, y- p/ D$ m# W
- exit 1
3 Y5 i# y% F! f* _0 D6 f1 b6 [ - fi
0 v9 i+ }/ y+ D7 ?' _, U) A - else' A3 q8 \# a7 J7 y$ y; A/ ~
- Log "Source path creation cancelled. No modifications have been made to your system." 1: f8 \6 ~* Y8 ^; O# ^
- exit 0
. E; P$ h4 |' K2 E& \1 Y$ [( d - fi
2 G% C2 {# q8 V: [* c3 j - else
2 s* |5 r. f5 G7 k- B0 g0 m& g2 _ - # Check for old sources
8 Z% V$ F6 S6 x e - if [ -d "$SRCPATH/server" ] || [ -d "$SRCPATH/database" ]; then; O1 Q9 K+ ` m+ G# R2 S+ `
- # Ask to remove the old sources4 n1 @+ C6 G" m I
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Path already exists" \0 V0 C; A4 f/ h, \/ u+ i+ ?; X' i
- --yesno "Would you like to remove the old sources? (Answer yes if you are cloning MaNGOS)" 9 60) o: [& w4 T# F+ E
- 4 s3 L. h3 j8 Y- h2 }
- # Remove the old sources if requested
`' P. X. b8 j7 e - if [ $? -eq 0 ]; then) r. i7 w4 t% E: {
- Log "Removing old sources from: $SRCPATH/*" 1
1 v+ d* ]5 W* I) e4 ^ v+ D - rm -rf $SRCPATH/*' F" Z8 \. |. @; W) D
3 [4 Y3 Z0 z8 I/ b6 z& t- # Check for removal failure3 Z2 `& E4 W2 Y# p, N0 n' x& [
- if [ $? -ne 0 ]; then
% a2 @ _/ ]; I - Log "Error: Failed to remove old sources!" 1# h0 Q9 _% {0 [* m9 q
- exit 1- @* l1 z5 Z5 ~/ J7 n& p% V' D
- fi
! A H( ?7 B+ V3 D+ n: N G - fi4 R* ?4 C: o% P7 P& H2 L. j
- fi- _$ U6 V' L/ D+ @! c5 [. C. l: B! c
- fi
; X% G% y% Z2 X1 _& ]$ l' E: s
$ l0 K0 m2 Z4 f4 ~9 \+ s2 Z) n- # Set the installation path) i: g& K# h) i$ F% E
- TMPPATH=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Installation Path" \: I0 m7 `0 q, ]
- --inputbox "Default: $INSTPATH" 8 60 3>&2 2>&1 1>&3)
% Q1 J7 a5 M' A$ ?
+ I$ `" i) @$ q- # Exit if cancelled
4 s; Y! l) Q5 z5 r$ J) b - if [ $? -ne 0 ]; then' Q ~, U8 X1 x- q
- Log "Install path selection cancelled. Only the source path has been created." 1
" V8 ?# L1 q1 ~8 g - exit 0) s9 h' [5 `2 ^. @3 n& S
- fi
- Z% L$ l6 ?7 X- Z# {3 W' ?
) k" ^/ _) h. \! t" |- W$ [- # Change the path only if it was modified
J: H% G% x+ X7 r( u - if [ ! -z "$TMPPATH" ]; then3 v8 K: d) L7 D# G. }9 c, a! n
- INSTPATH="$TMPPATH": ~8 N, i# }: l! }6 l& A
- fi
! R+ u6 G) a6 ~$ J" X1 ^$ y. Y
) _' `+ Y$ N2 j% z$ |" M! U- # Validate install path
) Y: H7 Y; R# H' R+ [# S' p - if [ ! -d "$INSTPATH" ]; then
3 Z; D& m2 e. z* T% N! L - $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Path does not exist" \8 G: @* P3 h* D& e* L# u5 r
- --yesno "Would you like to create the directory "$INSTPATH"?" 8 60
* N" l/ m' J+ U, g2 h) b' S
2 t5 x1 O$ u6 R: @. P+ y( ?: y- if [ $? -eq 0 ];then' N. i! s! y/ x- i8 J3 z/ C* n
- Log "Creating install path: $INSTPATH" 13 m# P7 n& [( ^+ m9 N
- mkdir -p "$INSTPATH" > /dev/null 2>&1
5 ^8 J! ?; u& A1 `
* s* t6 ?5 U# m' J+ [- # Check to see if the directory was created
: O' z7 d! n% { v) R! i l+ x* O1 J - if [ $? -ne 0 ]; then* r. g6 m! B4 \3 t8 n
- Log "Error: Failed to create the specified installation directory!" 14 m: a7 w) _; p2 C
- exit 1
& @6 L8 x: ^) y( ]& l- A - fi
6 b- Q0 X' E- _, i5 {: d, ?' J9 C- l - else7 r; V& V+ |0 u* e4 X9 W
- Log "Install path creation cancelled. Only the source path has been created."
! l, w/ Q2 V$ ? _# y: s. ] - exit 0" J2 l* o$ P T- [
- fi+ n8 m* G$ G- q/ E' x4 l4 e
- else* }5 y0 { F6 _; Z
- # Check for an old installation' y+ ]( i( [( |- s; X
- if [ -d "$INSTPATH/bin" ] || [ -d "$INSTPATH/lib" ] || [ -d "$INSTPATH/include" ]; then
0 Z) y( D/ k2 C8 |; L - : L9 m( t0 S3 l* F- S) F
- # Ask to remove the old installation, @% H5 F) x2 L& b
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Path already exists" \
) w# h7 [' E: T: J! j - --yesno "Would you like to uninstall the current version of MaNGOS first?" 0 0
: E/ ^) v) g+ w0 ^# r6 q - 5 ^8 k ?# I' p1 d4 v
- # Check the user's response7 `8 J. R. \2 t$ G: I
- if [ $? -eq 0 ]; then
0 N( O7 Q E) e3 ?" l; ]4 u - Log "Removing old MaNGOS installation..." 14 O1 r. ^, t1 R6 [" t7 B. x: ]( {. Y
: u3 r% t3 G6 m6 W l- # Clean up the binaries
8 y/ ?* Z0 }5 N, ~+ C* W- q) { - if [ -d "$INSTPATH/bin" ]; then" _0 W: A9 _, C0 X3 I
- rm -rf $INSTPATH/bin' R' x. N0 g' ~8 l E" S2 D
- fi: `+ B% Z8 h2 Y5 l
5 f0 i0 j! m) w8 g- # Clean up the old includes
5 A0 Z: g) |2 L' ~ Y - if [ -d "$INSTPATH/include" ]; then5 C4 H6 H! K/ U: u4 W8 w
- rm -rf $INSTPATH/include) U( B3 }6 s' b) W' p
- fi7 P' @* t8 k1 s# {% J0 H2 |/ d
- & P3 E# T, l: [4 j/ e
- # Clean up the library files8 Y3 J7 ?& M, W, n
- if [ -d "$INSTPATH/lib" ]; then8 @8 l; o1 g4 A. v8 l# K- y$ f
- rm -rf $INSTPATH/lib
% t2 Y* D O+ x6 W9 z - fi) P* ^, P4 g$ C" Y V6 A
3 e& @9 @! J. n/ _6 A- # Clean up the old logs
4 G! C+ G8 o8 V - if [ -d "$INSTPATH/logs" ]; then
- I3 |4 q. _5 N. k1 _, o* o( n+ L - rm -rf $INSTPATH/logs/*; l+ X* I _# M0 q
- fi
}" H2 A$ R2 A- x6 N: Y# s" |$ Q - fi6 @- X, `" P$ w
- fi$ z! I: e$ l$ L
- fi4 }, {" E* Z$ v$ v0 F
8 F, `* Y$ b/ D3 d) [- n* W5 L+ m- # Log the settings, C. j! w4 V& h
- Log "Install path: $INSTPATH" 0
* D. K5 r4 I% t$ ?/ q- g0 V2 e* I - Log "Source path: $SRCPATH" 08 g9 D: R% V5 b6 L
- }
8 B% n) E% ?1 Q" A. V, P& @! a5 c" O - , e3 \; s0 O7 q0 Z, g
/ I8 d. o% d, b+ O! l
: X" j9 |( [8 N4 [6 W7 U- # Function to clone or update sources) F% b+ S) H# X6 ]$ a( j
- function GetMangos()1 p) S% C+ Z# L- l# D
- {
- H6 C8 h n8 V5 b - local CLONE="0"
, \7 p( D+ @5 M/ h- a6 o - local BRANCH=""
" o/ `5 S; n% c/ n9 l* J+ @& H
2 {: ]6 L" K6 T, T5 g- CLONE=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Clone or update MaNGOS" \
i8 Q% F- H- O/ H - --menu "Would you like to clone, update, or continue?" 0 0 3 \, d; j! `. }1 @% G+ i
- 0 "Clone a fresh copy of MaNGOS" \
& A+ f6 z6 @/ M0 j. n - 1 "Update your existing copy of MaNGOS" \0 m, M& X* j, ~8 _) X2 j; M
- 2 "Use existing copy" \
5 W, z+ g- D. ]# F - 3>&2 2>&1 1>&3)
1 l9 T# s( V3 T1 ^" d& U - + j. ?; Q* l8 f( ~- O. j
- # Exit if cancelled
; }. }3 h. r: v. s9 r - if [ $? -ne 0 ]; then4 a7 i3 y& C9 W: a
- Log "Source cloning cancelled. Only the install and source paths have been created." 10 C8 r. Y ?# }& f: S. O8 R
- exit 04 {& R/ j+ c9 l3 J' W
- fi. R. J$ O5 `9 ^/ r; n5 p
- ' U/ \/ M7 Y% e9 R4 r9 `( @( |
- # Clone from scratch if selected' m, Q7 |+ j7 _2 T4 |
- if [[ $CLONE = *0* ]]; then
9 G' {& c# S3 k# G& T8 r - # Pull a different branch?
( p I; }0 I$ W8 p - case "$VERSION" in1 y$ a! w3 H# J! y
- 0)! @" ?$ b( t. \0 M! A: v
- releases=$(curl -s 'https://api.github.com/repos/mangoszero/server/branches' | grep "name" | awk 'BEGIN{FS="""}{print $4}' | tr '\n' ' ')
+ b7 x* \" k* K7 ^* w - ;;
2 v; t7 r3 `$ d/ l# b$ l1 L - 1)
2 d* m8 L3 \. c# L4 _ - releases=$(curl -s 'https://api.github.com/repos/mangosone/server/branches' | grep "name" | awk 'BEGIN{FS="""}{print $4}' | tr '\n' ' ')* j# P5 e, \% T, h1 G
- ;;
5 R8 k$ z3 n( j$ P+ {( o# r, J \ - 2)4 w+ Q0 O3 m4 N- N
- releases=$(curl -s 'https://api.github.com/repos/mangostwo/server/branches' | grep "name" | awk 'BEGIN{FS="""}{print $4}' | tr '\n' ' ')
) Q) C' z1 r8 V - ;;4 K4 B2 Q/ W( }, y& {
- 3)+ W P. J) }8 Q% B- Z# ]
- releases=$(curl -s 'https://api.github.com/repos/mangosthree/server/branches' | grep "name" | awk 'BEGIN{FS="""}{print $4}' | tr '\n' ' ')* [% A7 r4 P5 D# P5 R& J/ |
- ;;1 p- q1 T* @. S7 n
- 4)
; V9 z. g7 n8 n+ d0 R3 {4 c - releases=$(curl -s 'https://api.github.com/repos/mangosfour/server/branches' | grep "name" | awk 'BEGIN{FS="""}{print $4}' | tr '\n' ' ')3 N; _ {& e: `: N
- ;;
9 j* R3 \5 L5 M: t2 |" `; ]8 ^$ I - *)- [- N5 P2 l0 x2 a5 n% i, q, e. Q& Q
- Log "Error: Unknown version to select branch" 1
" E4 {4 P p# Y2 O8 A5 [ - ;;4 s, K3 b/ H* W6 r0 ]( L0 f
- esac" g5 g' R" x* |5 {- L
- + q. ]; ^' V% O" y3 a+ L3 p
- COUNTER=1
. k, R3 f |8 |6 a8 F, P' K9 P - RADIOLIST="" # variable where we will keep the list entries for radiolist dialog
% p9 X; n+ ]2 j% \- L2 Q) E$ i4 p# a" S - for i in $releases; do2 z, C! U2 O8 O. I# i! o7 E
- if [ $COUNTER -eq 1 ]; then: C+ ^1 Q* Y+ U) ], U3 t z$ C
- RADIOLIST="$RADIOLIST $COUNTER $i on "
' r. a/ o" ~9 w1 ? - BRANCH=$i3 O8 x8 e5 [3 s9 b- k0 `: o. A
- else6 u, h8 |7 t; m# }, ~7 N0 H6 }0 W' `
- RADIOLIST="$RADIOLIST $COUNTER $i off "
3 o7 `4 Y% Z- {7 P - fi6 b% o2 r( E# S
- let COUNTER=COUNTER+1
) j$ l1 @( f" ] - done u/ }. D: I4 R4 N, \
- 7 }* p* g% K- m8 \
- TMPBRANCH=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Select Branch" \
; f; g ~: d# I- g - --radiolist "Default: $BRANCH" 0 0 $COUNTER \7 V, [. _( Z/ [: N% t' }; A
- $RADIOLIST \
b' J: d/ t2 m( Q% c) t/ y - 3>&2 2>&1 1>&3)
7 p# z- J7 o/ e
2 Q9 f9 b9 M: R) v- # Exit if cancelled
, v' o1 n# g; G - if [ $? -ne 0 ]; then" p9 ~, m0 ^* a6 Z
- Log "Branch selection cancelled. Only the install and source paths have been created." 1
7 R# D5 _2 C( U7 {# T - exit 0
- F; w3 g9 h% O$ V1 o - fi, L+ m+ p5 T9 F. t. L
- + Y3 {6 r& Z3 X; \" U+ @
- BRANCH=$(echo $releases | awk '{print $'$TMPBRANCH'}')
* ?% ?( Q: v7 D# o- j - , n$ Q. w0 j! H7 D$ E
- # Set the branch
+ {- u# A V2 Y) z" I# d3 O- A - if [ -z "$BRANCH" ]; then) {9 v# r' |+ t( B6 \2 ~
- BRANCH="$releases | awk '{print $1}'" o/ z1 N q5 n I+ [& U3 b& a
- fi
2 U; @. b0 ^. Q
, D! h' |/ h6 z/ Y- X/ Q! C' q D- # Clone the selected version6 Z/ K5 x1 S" N% v. Z
- case "$VERSION" in; D1 v, H) Z' x
- 0)
; F( }$ p2 |! | - Log "Cloning Zero branch: $BRANCH" 1& p8 m3 V" n+ V+ N. y0 f
- git clone http://github.com/mangoszero/server.git "$SRCPATH/server" -b $BRANCH --recursive
+ J+ V4 U; {; A- E - git clone http://github.com/mangoszero/database.git "$SRCPATH/database" -b $BRANCH --recursive
) d% V x3 r1 f* A. p9 ~ - ;;
& T1 ^6 ]; k( ~( T& }' A C - : \* i. t" A3 {' g& h% F
- 1)1 m/ P( f! L( S3 Q4 W @7 Q; k* ?
- Log "Cloning One branch: $BRANCH" 1- G) l( O0 Z7 g4 Q0 W7 N5 W
- git clone http://github.com/mangosone/server.git "$SRCPATH/server" -b $BRANCH --recursive/ @+ \; {: B! R* ?8 Q* G
- git clone http://github.com/mangosone/database.git "$SRCPATH/database" -b $BRANCH --recursive
% }& H5 F' z, { \$ y' n" h$ l8 ? - ;;
7 P/ X9 i8 [) ]7 H8 `
* F) I/ ]; I1 g* x* T; W+ f( b" V- 2)
6 L6 K q4 }7 ~ - Log "Cloning Two branch: $BRANCH" 1
1 I* j" ]7 @; K& W& U% U, K. Y - git clone http://github.com/mangostwo/server.git "$SRCPATH/server" -b $BRANCH --recursive
b' W% N4 G: Y G - git clone http://github.com/mangostwo/database.git "$SRCPATH/database" -b $BRANCH --recursive
6 b; m, B. e+ @4 _ Y* f - ;;
, I7 L1 {* }& }9 m6 s& e - ?* H. j+ r, L8 U/ A
- 3)- c1 Y; a P# c# H9 p6 s
- Log "Cloning Three branch: $BRANCH" 1
8 n% T8 b# t2 ^3 w# d - git clone http://github.com/mangosthree/server.git "$SRCPATH/server" -b $BRANCH --recursive+ H. P/ p# e# X
- git clone http://github.com/mangosthree/database.git "$SRCPATH/database" -b $BRANCH --recursive
! S. _6 B5 T' ^ - ;;) d# A/ Y) _ x' y# i! o7 O
W# B) O: R. B% I i* I! `# N- 4)
3 C* X7 r$ R! H - Log "Cloning Four branch: $BRANCH" 1
% A) I! A0 n7 o0 p, _# O* R: x9 G - git clone http://github.com/mangosfour/server.git "$SRCPATH/server" -b $BRANCH --recursive" X9 P; w, n1 z- E' \& o' w
- git clone http://github.com/mangosfour/database.git "$SRCPATH/database" -b $BRANCH --recursive6 G# w8 K9 k/ k
- ;;9 P( [. Q8 j! L
- , H& k0 ]7 T% p: C
- *)& ~# K& x8 ~& H E
- Log "Error: Unknown release selected for cloning!" 1# ^$ p2 K! X- Q5 ^
- exit 1
& N# z& A( n; {9 y- ^* I% \ l - ;;
) _# B; Q" O* N d - esac/ |4 }0 p. h$ S8 K4 A
8 E+ y% J# ^2 C- S$ P# O- # Log success' X, y0 h7 e5 y& P- W
- Log "Cloned the selected repository!" 1
" g0 _+ o. `/ L4 R0 W; a" t - fi, v9 O: `/ i$ k- c @! {
- " E# r, F+ f; v2 c0 @
- # Update the local repositories if selected% f/ ]( B- a% k2 o @9 S, [; ?
- if [[ $CLONE = *1* ]]; then3 j! @2 n6 @8 G7 e. L O
- Log "Updating your local repository..." 18 `% J' @" b# d" N" F! N$ M8 M# u. F$ A
- 7 ?/ w1 l/ ?. x! T" n6 n
- # Update the core sources, M( @% S; ~' Y* Q# h) _
- cd "$SRCPATH/server". t0 W ? `; a5 i0 Z
- git pull
7 u& E6 l) V/ `/ Y. B# z( b - ) J- z# `( Q* X
- # Now update the database sources# p6 C7 R' S% }! s4 Z* w
- cd "$SRCPATH/database"
$ u @: Y+ m R* ^- _4 f& L - git pull
! B3 y, Q( ~3 t( ]3 o
3 z- `0 [* ]6 Y8 ~ m- # Log success
5 L$ Y4 ^6 l- m: c7 W- s( @ - Log "Updated the local respository!" 14 Y2 P6 O1 m$ ^, U
- fi
$ R0 [! o: a1 j* y7 _ - ; O1 l1 S6 Z- I) A7 A3 H6 V: V! @, `: {
- # use existing repository
, i4 H7 I3 r7 G2 m* z - if [[ $CLONE = *2* ]]; then
. v) { @% l/ A( o+ I' o: s - Log "Using existing local repository" 14 O7 g: J1 s& ~% d: |7 L
- fi
* g( Z% ^; d y+ k - }
: }: z5 @4 M2 g
* a: \0 C% l2 j5 y& D
% M/ m- W' a7 C2 i, k- ' X2 r7 Z& i7 g$ H& @( D8 |
- # Function to set the build options1 F' Z5 ~& c( _' w
- function GetBuildOptions()
6 o0 S" U5 M4 }5 \6 q - {
' J0 }) E- `2 s, ~$ W3 @3 \9 t X - # Select build options& A( C4 w9 f, h) [% w1 A2 m
- OPTIONS=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" \
0 p- S. H+ Y5 b$ n1 k - --title "Build Options" \
- E) K% p( P+ W" Q! ]$ F - --checklist "Please select your build options" 0 56 7 \3 E$ v* N/ m: o
- 1 "Enable Debug" Off \
g( }, k7 [6 s; L - 2 "Use Standard Malloc" On \
( t3 v* @# ?9 _0 h4 p - 3 "Use External ACE Libraries" On \
/ i$ }6 I, ?4 T+ ? U4 \5 b1 u - 4 "Use PostgreSQL Instead Of MySQL/MariaDB" Off \* ?0 {. h* N' B0 i, P
- 5 "Build Client Tools" On \
; ~5 ^: }( o! u: D* o2 x* t( p - 6 "Use SD3" On \+ x' H5 T7 E8 I& U
- 7 "Use Eluna" On \
/ d& ?4 L6 S9 x - 8 "Use SOAP" Off \
: w+ ^# g* y9 l1 c- H+ [* e - 9 "Use Player Bots AI" Off \
& i% F" Q: n& d, h - 3>&2 2>&1 1>&3)
1 S# s: T& j1 b - 7 S: v+ o0 G4 L# e/ F+ p: }5 `
- if [ $? -ne 0 ]; then
7 J$ `; {' w! j% _8 s, F - Log "Build option selection cancelled. MaNGOS sources have been cloned." 1
E2 {: M7 H* E0 X; I/ ]7 t* }5 ^ - return 09 s. A" r4 O( `- [. w$ b; ?% G
- fi
0 s7 o) k9 K4 x2 B2 m' W" `+ Y - 2 N9 n5 s9 c& q, I% J$ k
- # See if debug was selected% `$ l; x. ~ K/ t
- if [[ $OPTIONS == *1* ]]; then# i: T- a$ f: w8 B7 q) S% X2 c0 z. @4 T
- P_DEBUG="1"
* I( N% P4 `* K - else9 O! i2 X: N1 \ P' i; K
- P_DEBUG="0". D9 `. x& K, p* p; \
- fi5 f/ {' n, V3 D' q6 c& J- C7 t% g
" j/ |: r* Y5 {3 W: B9 w- # See if standard malloc was selected H# j9 v+ W2 ^0 M* @0 e6 G* W
- if [[ $OPTIONS == *2* ]]; then
0 O" ~% b6 t" `! {0 J - P_STD_MALLOC="1"
, ~! S4 |0 W, ~# I - else
4 g, F, G, v6 ^; [! K1 y - P_STD_MALLOC="0"
% b+ x( v5 g! W U8 \ - fi
/ c; p/ I3 ?; s) Q6 F& G - . y2 L0 D3 E" `$ K/ ]* e
- # See if external ACE was selected' u5 G- H) n0 M* l9 i
- if [[ $OPTIONS == *3* ]]; then
9 s; i- R" d' i0 _# E# O - P_ACE_EXTERNAL="1" {- i0 R- `0 B/ K, g
- else, Q ]2 W# Q' C1 S6 h
- P_ACE_EXTERNAL="0"$ a( D: y# V+ o! Q2 d, _( U% ]
- fi
: b5 |$ ]& d" S
: o- W* X: S/ P- # See if PostgreSQL was selected3 `/ D/ S j' |2 C" K3 }3 t/ ~
- if [[ $OPTIONS == *4* ]]; then
5 l" q2 z+ W; y% D1 U" B - P_PGRESQL="1"8 ~2 G6 D" @7 a- T; Z; X
- else* {7 M" H: g0 W4 h0 h
- P_PGRESQL="0" U) y' k, w+ H5 e
- fi
( o5 g( [, j+ S7 m
0 g/ g( y/ d$ t" l- # See if the client tools were selected9 G' @# h M% a: l' ~
- if [[ $OPTIONS == *5* ]]; then) J+ A' b8 b( a4 _
- P_TOOLS="1"0 }: U% X9 w* M8 {$ {
- else. ?0 g* M/ W9 d' B: D; o
- P_TOOLS="0"8 s( H: U# e9 O/ r* s
- fi
' ^( K X( L# A; k
5 v+ A7 |# F# ` _- # See if SD3 will be used
& n( M& G- w0 x* o' }; n, }1 F3 \ - if [[ $OPTIONS == *6* ]]; then7 m- x0 o( M% W8 l6 @ j
- P_SD3="1"0 o) e' k+ Y. I1 a2 D
- else9 _1 H' \; h& U& d5 ~2 @" V
- P_SD3="0"& h! V& e2 g: J& \1 Q8 ^$ y
- fi$ l) D, U- f& d2 q' L z
- 2 _: z3 ^5 O& I, K! q+ x
- # See if Eluna will be used) Q0 B$ }0 f# e3 f/ j7 p) z
- if [[ $OPTIONS == *7* ]]; then) w' B/ v x: y7 h& s( k3 _* r
- P_ELUNA="1"
; k) H: C5 l1 Y: G; E/ L6 e+ C2 K - else
0 D* d: j6 n g" p0 v( ] - P_ELUNA="0"
; u# L6 x. g6 A: }+ | - fi# w! P8 C5 f" x; F( z f/ F
" {, G6 K+ |: H4 k3 X/ b( N- # See if SOAP will be used. o( {; x/ R H( R, x& x# t% v
- if [[ $OPTIONS == *8* ]]; then) U; v0 ^! N" t+ z x* ]) o1 g
- P_SOAP="1"
' K/ s' q, H- ^9 J - else# z" a2 L; l& I! e) p5 v6 l* z( s
- P_SOAP="0"
. H4 P" K2 P3 i, d+ H; K6 S - fi0 p; p7 V& {3 k/ O
, C% s# M# s% }" ^4 E8 F2 R4 [- if [[ $OPTIONS == *9* ]]; then9 J3 c# p0 Y9 Y
- P_BOTS="1"
/ c: |/ j0 w7 v7 O3 r F - else r4 K7 }/ p( r/ h1 R. A5 L
- P_BOTS="0"
, U# V g+ X; E9 X; `( T- C - fi
% U/ b8 a0 f; m$ W7 p l
8 x1 S- M+ y& \4 V- # Verify that at least one scripting library is enabled
5 r4 D- b1 o+ Z8 r2 t. W1 h, @! K - if [ $P_SD3 -eq 0 ] && [ $P_ELUNA -eq 0 ]; then. F3 {6 l, ]& s/ l- E& Q2 z# s
- Log "Error: You must enable either SD3, Eluna, or both to build MaNGOS!" 13 _- J4 _7 I- Q, t/ R" ?
- exit 1
0 L% |3 \. t$ u/ O" j4 W - fi
/ e1 x1 R1 r* @; l. T' z - }
" D) g) M4 S+ I
$ n* D8 { O' C- , l, L5 M6 f6 \( A7 Q
" g0 w0 P! h# T% w3 ?- # Function to build MaNGOS
4 q9 X% e$ E) R. G - function BuildMaNGOS()& h: ?4 N8 I7 e8 T" u6 ?
- {
" m( p$ b* K5 z1 O0 v - # Last chance to cancel building
4 n# s, D' g7 l - $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Proceed to build MaNGOS" \3 C* s6 j6 z* [3 F) U0 Y
- --yesno "Are you sure you want to build MaNGOS?" 8 607 m0 t: E0 _; Z
$ r4 C1 Z6 L, k. [" q/ E4 l- Y- # Check the user's answer, b% R$ t% B. P6 @0 r' A8 g
- if [ $? -ne 0 ]; then
' [ S( f4 X( ^' S {& d - Log "Cancelled by user. MaNGOS has been cloned but not built." 17 ~) {: z! h/ z+ N, w# U5 A, d
- exit 0
8 A3 N8 ~) z; {; Q0 L K$ ? - fi: O* F6 ~" g" X# ?' _
- , n: v! r) G2 r) G. L( D) D" U
- # See if the build directory exists and clean up if possible' C: Z* |6 g3 ?* ]% H+ {* s
- if [ -d "$SRCPATH/server/linux" ]; then
/ e1 l5 ^$ K/ N' X: I& ` - # See if a makefile exists and clean up2 S6 {% D& L& k$ M/ F+ `9 I0 v
- if [ -f $SRCPATH/server/linux/Makefile ]; then) l8 n/ e0 O6 v3 J
- Log "Cleaning the old build..." 11 G2 i0 _' l! Q1 v
- cd "$SRCPATH/server/linux"
* _+ [$ A$ P4 r/ B - make clean
: d# d7 e# [* e. ]$ C P, G9 N - fi2 j) j* L5 u* A. e2 k( J+ @
- fi
, G( H" x! d& S- z5 Z, T* [ - ) p7 N# h0 I( {
- # Attempt to create the build directory if it doesn't exist( P3 N0 v% r. N C
- if [ ! -d "$SRCPATH/server/linux" ]; then
K) |# g% m0 B) A0 M2 o - mkdir "$SRCPATH/server/linux"
' T0 e4 P% l X) J4 G
: e* a O8 d: B2 U4 m4 H: Z t" @- # See if creation was successful2 ^! @ {5 a5 Q6 ?8 \" x1 I g n
- if [ $? -ne 0 ]; then
# X& b4 |, l! |' h - Log "Error: Failed to create the build directory!" 1
. A# G' W3 U- p; {. ] v2 Q1 q7 ` - exit 1
: ~5 F9 b4 B$ _9 X7 l' J$ B. U8 u - fi
/ k# G D" g' u0 T - fi* W0 C) x2 y/ s5 ^
4 s% f# t4 r; u2 `- # Attempt to configure and build MaNGOS4 A' @9 H- o7 |, u Y
- Log "Building MaNGOS..." 0
8 H% C* V$ V( Z. n, V6 U3 t - cd "$SRCPATH/server/linux"
3 o4 _1 p, Y5 x7 | - # make sure we are using the cmake3
" S) z; {; B& [1 z, ?0 k- d - UseCmake3' I' U1 f- x/ Z: b& {1 N f" q
- $CMAKE_CMD .. -DDEBUG=$P_DEBUG -DUSE_STD_MALLOC=$P_STD_MALLOC -DACE_USE_EXTERNAL=$P_ACE_EXTERNAL -DPOSTGRESQL=$P_PGRESQL -DBUILD_TOOLS=$P_TOOLS -DSCRIPT_LIB_ELUNA=$P_ELUNA -DSCRIPT_LIB_SD3=$P_SD3 -DSOAP=$P_SOAP -DPLAYERBOTS=$P_BOTS -DCMAKE_INSTALL_PREFIX="$INSTPATH"
) l- [& x* F1 v) U. ?: C0 a - make. H' [& Y* u( j
& O% [# o" e& b& [ V' T- # Check for an error
7 L* B8 T4 d# \! d9 g- q' j - if [ $? -ne 0 ]; then
; J+ I/ `- Q6 c2 ^# q9 P# q' |3 J - Log "There was an error building MaNGOS!" 1
8 y6 K9 E2 E& Y9 i- l( D - exit 1# T! j" v9 o3 ]
- fi. o# b6 k, F# O1 u( G; i& H
- / d2 z# @* d- v( A
- # Log success
: w. i& f* e6 p) Y" v# s2 K - Log "MaNGOS has been built!" 0
. m. f9 H# T! [; l1 h' n8 } - }0 A/ ~4 w! i1 ^9 N, L! ?4 m
- 1 J4 j& F! h8 ?+ O% m- p* b
- , J. z. l9 P+ m9 U- U3 q
/ K, ?1 ?" H& e# A& M% ]: X- # Function to install MaNGOS
+ B; {5 B! Q; { - function InstallMaNGOS()& n. W' A7 Q. @" J; |8 l
- {8 G# _/ a9 }7 R: l
- # Ask to install now5 V& m! w$ w: \! v4 e
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Install MaNGOS" \
4 N% T& M& l: m4 y2 L& x - --yesno "Do you want to install MaNGOS now?" 8 0$ |3 a) E7 j% w
- : G& T I' j: L8 O9 W
- # Return if no
0 ]: y' B$ b- d - if [ $? -ne 0 ]; then
2 g) E2 s% i: M" a - $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Install MaNGOS" \& W3 E7 }8 w2 e. b8 F2 [
- --msgbox "You may install MaNGOS later by changing to:\n$SRCPATH/server/linux\nAnd running: make install" 24 601 a5 x: @! H2 s, T+ {
- 1 }' b6 O9 {# u& @2 H$ m% ^
- Log "MaNGOS has not been installed after being built." 1 I( V+ W8 S% U% `2 f
- exit 00 k( L" ]2 S- p4 P, F
- fi
, H3 I9 f# e' N7 F - 3 e. j4 {2 Y4 L" x( E* | X
- # Install MaNGOS
. E1 y# M5 _$ h Q" W" A - cd "$SRCPATH/server/linux"% N8 U' l1 G# a2 H
- make install
1 ?7 p' @- F M: c6 H8 ? - ) A# X' F2 U. o* F2 Y
- # Make sure the install succeeded9 d( |0 X7 T) H7 D0 P
- if [ $? -ne 0 ]; then
! |' I6 U; B/ n: h! M6 D: I% @ - Log "There was an error installing MaNGOS!" 14 l& m% X. z* r; k% z, b3 a& ~
- exit 1) W& H1 e3 q% h- O: ~. `, ^" |
- fi) K$ a% L- C4 L$ w! {) U8 D
- }/ u6 u% ]" I! | }7 A# o/ B; Q
, S# R( c$ D7 S+ U7 N! u" }- # Function to apply database updates
; W% T' o! |' Z: G, Y! w - function UpdateDatabases()
- m1 O, R( [( Z- x! k0 m - {
% c. i, W* y9 Q# l - local DB_HOST="$1"
2 I4 _+ J9 K8 r# q - local DB_TYPE="$2"
1 U3 @8 S u9 i1 o% g - local DB_COMMAND="$3"
V! N: J8 X% R - local DB_USER="$4"
2 S+ ^* n* i- l, z$ w - local DB_UPW="$5"
3 S- ^0 n9 E8 \& s" U - local DB_REALM="$6"4 J: h/ m/ ]+ M; |9 v% O. F
- local DB_WORLD="$7"
$ c! H/ k y, \- J8 Q - local DB_TOONS="$8"
) a& J# e6 J3 b" e$ {
. m1 ]3 S) u/ J- # Loop through the character files
6 Z1 v0 L! X3 z" B' i) ~, w - for pFile in $(ls $SRCPATH/database/Character/Updates/$(ls -a $SRCPATH/database/Character/Updates/ | tail -1)/*.sql 2>>/dev/null); do# N4 m: _. u3 e
- if [ ! -f "$pFile" ]; then
# W: w" @. D# @4 j, e - continue
1 Y+ y) B; R! H: i1 y/ o - fi) X: u8 E3 E6 o2 i+ @
- # Attempt to apply the update. @7 q9 O4 V5 @8 _3 \* [
- $DB_COMMAND $DB_TOONS < "$pFile" > /dev/null 2>&1/ l' S& n3 V; k% F* P6 {, }
% } M/ k7 H+ C+ Z' ^2 Z* P- # Notify the user of which updates were and were not applied
x9 J6 O' E. F4 J+ p$ b8 [3 C+ W - if [ $? -ne 0 ]; then
- t p5 Y$ s; T: T/ m, N - Log "Database update "$pFile" was not applied!" 0
- F6 K. `: E; I& Y2 b# s - Log "Database update "$pFile" was not applied!" 1
% S' v$ o' d* a) r* N" ?2 ? - else
, ?* h( p/ r `# j - Log "Database update "$pFile" was successfully applied!" 0
4 P1 }2 ?! Z" n - Log "Database update "$pFile" was successfully applied!" 17 ?, i5 H3 A4 m3 m1 R' Y; P3 ]
- fi+ d. h- F7 W/ e3 ^: E
- done3 t' |+ ?) H- v6 R9 s
- - U+ |0 C( q6 V: P* `7 s3 }
- # Loop through the realm files
0 d, v/ @9 a. t# v - for pFile in $(ls $SRCPATH/database/Realm/Updates/$(ls -a $SRCPATH/database/Realm/Updates/ | tail -1)/*.sql 2>>/dev/null); do# x! n' R' ]2 t) V$ g2 I
- if [ ! -f "$pFile" ]; then. |- V8 o+ W: }! O
- continue8 W8 T; D0 B6 |! F5 N& Z7 u- ]! Q
- fi
( D7 B; e& n. t9 S6 |/ ^4 @ - # Attempt to apply the update0 i! V! D/ I# P# I
- $DB_COMMAND $DB_REALM < "$pFile" > /dev/null 2>&1
J) S2 p9 H5 U8 ~! j0 z- x - 5 o$ f8 T, O3 \: w, l
- # Notify the user of which updates were and were not applied
; I! g1 ]! s0 F+ C - if [ $? -ne 0 ]; then
; x# K+ c0 ]2 T% n - Log "Database update "$pFile" was not applied!" 0! {0 g, T% G" u1 o; B* d% l
- Log "Database update "$pFile" was not applied!" 1( j z$ t( Y: L' {
- else0 H4 T4 H: y3 }2 r/ p1 t/ o$ f; L
- Log "Database update "$pFile" was successfully applied!" 0
1 C) }4 {; `+ T$ B# b+ ^ - Log "Database update "$pFile" was successfully applied!" 1
+ e; |' J7 F! p% d - fi6 S; {. z4 O# @2 B
- done
1 t6 u# j2 ^) {+ \$ }- R& p - ' p* u5 H7 l0 F" T- I
- # Loop through the world files0 z2 Y# p; L+ U6 R- V, C
- for pFile in $(ls $SRCPATH/database/World/Updates/$(ls -a $SRCPATH/database/World/Updates/ | tail -1)/*.sql 2>>/dev/null); do3 V. c* N; f' N0 H1 S
- if [ ! -f "$pFile" ]; then
` L! p4 e) w* o, @/ F' F - continue
$ D2 w9 k% R1 E# ?! A - fi
5 K, f- |" ]: E6 Z - # Attempt to apply the update
& I/ V1 s7 R) Y; X, @0 m0 P - $DB_COMMAND $DB_WORLD < "$pFile" > /dev/null 2>&1
7 P3 D9 q6 y# d+ g
' u: q/ F) q+ r+ j& f- # Notify the user of which updates were and were not applied1 F) D$ J$ o8 V3 U" o
- if [ $? -ne 0 ]; then
1 T2 H9 z d# q! k" p* G" D- w - Log "Database update "$pFile" was not applied!" 0
% K ~0 M8 m0 _* t- u - Log "Database update "$pFile" was not applied!" 17 ]) Y h) `' ^: v
- else
8 u# l/ y3 M& _* E - Log "Database update "$pFile" was successfully applied!" 0$ e J. X1 E2 d8 D5 A& ~
- Log "Database update "$pFile" was successfully applied!" 1
# G, T0 ]# ~* | K4 Z3 c( x - fi
$ P, A% M( T3 u" K2 e9 x7 l& I - done- l8 v0 C6 p% m) c( Y. V, s
- }8 d7 _, a% F2 f4 W1 M2 c; S# e
- . i) d# c# a; x8 i! ~
- # Function to install or reinstall the databases
4 N- c/ ~" j! Y; P - function InstallDatabases()
" c+ a. V" P# [& {8 M0 o - {
* ], V7 ^1 l6 \: A$ k5 [0 N - local DB_HOST="$1"- y r" J0 G) B+ |8 p- Z
- local DB_TYPE="$2": e. J3 Q1 }/ @5 p( }. O
- local DB_COMMAND="$3"8 I; X( P2 _+ c! H& W: p
- local DB_USER="$4"# S% S5 h9 Z; ~* _& c
- local DB_UPW="$5"
% f+ Z7 d7 K5 a* | - local DB_REALM="$6"% D' Y& z+ x0 d0 u" C. A& n3 D3 a0 v
- local DB_WORLD="$7"
7 z3 j) h; q: \# h - local DB_TOONS="$8"
: H2 J' q" _1 O1 T) A; | - , g& M3 B9 L" y% C
- # First create the realm database structure
4 h. v: l/ x1 j$ Q) B5 _- D' T - $DB_COMMAND $DB_REALM < $SRCPATH/database/Realm/Setup/realmdLoadDB.sql! ^( \# C- _9 l1 H3 C& I* [1 e* W
- ( d. y$ P7 _' O9 X2 c( N
- # Check for success8 X9 j8 u# S' R* `* w
- if [ $? -ne 0 ]; then- @# Z* x) E) W( ~
- Log "There was an error creating the realm database!" 1
3 k, X9 Q6 }) }* J6 g3 m# ] - return 1+ r: `0 U% k9 M3 s1 |5 G/ N7 H/ M1 S
- else' G: a( }& X' V/ x* _
- Log "The realm database has been created!" 15 K1 {: h6 @9 y7 T
- fi* O' \" O2 W9 U2 w
) O' k5 ^. o" u- # Now create the characters database structure+ i# i0 d3 c, d/ O
- $DB_COMMAND $DB_TOONS < $SRCPATH/database/Character/Setup/characterLoadDB.sql: d1 F0 H3 u- k6 g; x$ E; W/ w
( e( L; n; B; ^4 ?, H' r0 N: E6 u( b& B4 J- # Check for success! A: @+ y. P, [% r! A- C: X
- if [ $? -ne 0 ]; then
' b5 B, ^2 H" T) `$ t - Log "There was an error creating the characters database!" 1
4 ? _) S- m, y- W- K% O% o" x! N - return 1
( E; { n% m. t" D( a2 X' H - else' O$ ^# c' u0 k4 Q T) _/ V
- Log "The characters database has been created!" 1- T9 H$ ^. b: `: n1 m a$ i9 k8 F
- fi2 u L: {2 i! p" }; d
- ; I. ?, w+ G m$ [* ~
- # Next create the world database structure
- n& t3 U) [) s - $DB_COMMAND $DB_WORLD < $SRCPATH/database/World/Setup/mangosdLoadDB.sql( u3 ]8 q! K6 q, Y7 U- a1 U/ ?
" @7 x( B7 j7 C/ {1 d% `- # Check for success8 A( O G0 z7 h1 u4 E. x
- if [ $? -ne 0 ]; then
: i, i: E( }! k5 Q: ?! R$ N) x - Log "There was an error creating the world database!" 1: H% O3 c5 {+ N8 ]. J! o( r
- return 14 `5 e5 }" Q% Q4 t. _7 a
- else; M( i2 U4 B/ y' G
- Log "The world database has been created!" 19 i: ] d' L% V9 p9 L1 o3 i
- fi
" @" x0 z1 W" q b
0 d _: M! ^+ _7 c+ U0 T5 `- # Finally, loop through and build the world database database
8 b: @) m5 b1 C/ v! A E- B. G - for fFile in $SRCPATH/database/World/Setup/FullDB/*.sql; do Y+ s5 `/ h/ y+ G, Q; X
- # Attempt to execute the SQL file6 R0 F% o" A$ r0 ?1 n0 K
- $DB_COMMAND $DB_WORLD < $fFile, O6 j, \/ u# O+ N' v$ N' @) \+ E
- * A( @0 `! Q. e$ ~! p0 I* e8 y
- # Check for success
5 L7 d9 ]5 q* {1 i2 F6 J9 h( C - if [ $? -ne 0 ]; then/ i7 Z* w) ?; ~' S/ W o R
- Log "There was an error processing "$fFile" during database creation!" 1. u& ]4 \. J! \/ X. m2 f! e
- return 1
' u7 a" O3 F) P6 s2 i! a: k; |+ a - else, B- W5 D3 }: [6 Y
- Log "The file "$fFile" was processed properly" 1; M2 U6 ~2 X! J, X; z5 k2 t2 @/ B
- fi. `/ h5 g$ ]8 {- e; x
- done! _3 T9 T/ M. e) c$ o% G
0 u+ r8 G/ d i- # Now apply any updates
0 G; V) I" H3 }) a+ L0 g; }' K n( C! ^) W - UpdateDatabases $DB_HOST $DB_TYPE "$DB_COMMAND" $DB_USER $DB_UPW $DB_REALM $DB_WORLD $DB_TOONS
; |( C7 v/ \! T6 U - }+ n4 F+ V& ^5 ^' b$ g8 o7 L$ J
- * l d2 m3 h" O$ C: j2 M* O
- # Function to install or update the MySQL/MariaDB databases3 g; U( v/ |& W- M6 q
- function HandleDatabases()
9 ^+ B3 ^% O; z A - {
; J/ D5 d. g6 O2 G B+ o - local DBMODE="0"& \+ b& ]7 g( B5 b I7 ], G. S
- local DB_TYPE="0"3 C$ |; B! p0 p3 F- b' R2 R1 D
- local DB_COMMAND=""( f4 a7 |0 Q" {* R/ z; ^
- local DB_TMP="0": ^2 [1 p' g7 c5 N5 L
- local DB_USER="mangos"1 T2 K- ~. B% C# R
- local DB_UPW="mangos"
+ z) _5 w& s5 `- A2 B& U* X - local DB_HOST="localhost"( W& J. _# O/ C- \7 T a* _
- local DB_PORT="3306"
/ K0 b5 G6 p6 r - local DBSEL="3"
% ~2 L" _8 I8 }& M - local DB_REALM="_realm"( j2 K; |# k; h E7 V" K' E8 H+ w, p
- local DB_WORLD="_world"
+ D) S# T; a4 L - local DB_TOONS="_characters"( B9 X+ {" X5 A0 a0 l3 V' V$ s
- ( x& E/ a& ?; x& u3 X; Z( |" ~) A
- # Ask the user what to do here" C/ {, w0 v& R* \" z
- DBMODE=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Database Operations" \% j8 f+ x8 ~( }5 y) N+ J, J, z9 I
- --menu "What would you like to do?" 0 0 3 \1 `1 s4 i7 f/ K# l: u& i' |- l; S
- 0 "Install clean databases" \
& j, U: y9 x) G: J, \1 N" A! J - 1 "Update existing databases" \1 y! j- p: G2 v5 T* k
- 2 "Skip database work" \
" X4 l* R6 R( t Z9 z7 I* d - 3>&2 2>&1 1>&3)+ J. H0 U: F" W) L
- ; M. E" t1 M7 |% B/ e
- # Exit if cancelled/ L5 t, e2 I! Z- Z$ A) f% e: A
- if [ $? -ne 0 ]; then4 a4 N; a. v) [6 g# N$ Y7 c8 K0 n
- Log "Database operations cancelled. No modifications have been made to your databases." 13 I- |) F3 p1 F1 d/ e3 U
- return 03 D8 Q- }% L7 K
- fi
! R9 z- |5 _5 z% ]: m6 F$ O8 X - 9 M5 [4 C- F1 ?) ^/ u. X
- # Exit if skipping
; C% h% x4 Y2 e5 \) _, S - if [ "$DBMODE" = "2" ]; then5 s! E) t( v! _
- Log "Skipping database work. Nothing has been modified." 1: Y) i1 g, r1 Z0 m1 s7 A: k
- return 0: r J4 Y2 a3 R/ m& B" q$ J& D+ Z8 Q
- fi
A. r7 V, Q/ K, ]) g' _
2 q! p# w6 {+ s3 f- # Ask the user the DB type
2 h; k* F/ d) g w. I - DB_TYPE=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Database Type" \
& e0 `/ F4 M8 }9 E. | - --menu "Which database are you using?" 0 0 3 \8 T+ D9 E; F1 }* x$ t
- 0 "MariaDB" \
; Y/ H+ y9 b; }% G& {0 ]" z$ y - 1 "MySQL" \* s2 R3 i1 `" [! Z5 s
- 2 "PostgreSQL" \, F6 G2 Z# ?7 {4 n/ c$ r
- 3>&2 2>&1 1>&3)
. |, C) X3 y. |: d) `# \6 f0 ^! [
3 T) m) S Y4 _$ c* z. g/ Z1 i- # Exit if cancelled+ j7 Z! i4 m7 h3 P
- if [ $? -ne 0 ]; then* I& G* K% W1 U" e B5 h! d
- Log "Database type selection cancelled. No modifications have been made to your databases." 1( E( {) H2 I5 }' U
- return 0
7 s# M) Q/ _5 i - fi6 ^) E! s* Y" c' x% Q& Y! |5 E/ Y: p, c
- 0 J# d7 O( O) L* \9 F6 d% b
- # Get the database hostname or IP address" }. [! P/ z9 n4 w
- DB_TMP=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Database Hostname Or IP Address" \' b9 o# w5 w- h8 a
- --inputbox "Default: localhost" 0 0 3>&2 2>&1 1>&3)) W8 e4 Y7 W) Q5 h1 g$ s
- * T# H, V: V X8 k. D, m
- # Exit if cancelled
1 ]5 L; A3 [: J$ d. Q6 C - if [ $? -ne 0 ]; then
# r$ C9 Z! T# B) G5 x% f - Log "DB host entry cancelled. No modifications have been made to your databases." 1
- w: Z4 V3 `* e1 y+ A" B - return 0, L( v! N! Z6 _2 ]
- fi" S, K# g5 ^! ?. R/ z1 ?2 Q: X
- 6 M$ B0 [5 v; y# G7 y: \* v
- # Set the hostname or IP address if one was specified0 \1 s/ x0 r6 n) m" r! x
- if [ ! -z "$DB_TMP" ]; then. i$ d' K* H: Q2 m9 G8 n" P
- DB_HOST="$DB_TMP") M. h, f/ b2 i# `1 _- I& a% X7 s4 j' T
- fi( k4 h" s. ], P/ t
. K+ i9 n6 S" ~! o- # Get the database port
% \1 B7 ^1 S; w: u" V' ` - DB_TMP=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Database port" \: V# l6 J" H' q4 |* p: v
- --inputbox "Default: 3306" 0 0 3>&2 2>&1 1>&3)- q! I% ~$ U/ k9 N+ P
+ S- r# J% N% Z, D# {- # Exit if cancelled
& X( ?; ?. |9 o6 ]; O* a5 W2 J- ]+ { - if [ $? -ne 0 ]; then
# `5 n+ z4 X0 z$ B% c - Log "DB port entry cancelled. No modifications have been made to your databases." 10 k7 g- s ^3 r8 R1 B; ?1 z
- return 01 h9 C! Y$ j: b. @
- fi# _% J: V! [* \9 }6 L9 j0 ^7 D
2 D. q: I/ r; q/ H4 b3 r- # Set the port number if one was specified4 Z6 ?9 {" ]% N" |- S
- if [ ! -z "$DB_TMP" ]; then
8 q/ M% E2 H+ j, ~: V; x - DB_PORT="$DB_TMP"& u; U7 I+ b) f7 d, E: w
- fi
; o9 o+ C3 q' B9 V% L
7 e& O1 o/ m l q0 I7 o: z- # Get the database user username, m/ y, j6 e! R) i1 Q+ V
- DB_TMP=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Database User Username" \
d8 p: E2 }# r, R, \ - --inputbox "Default: $DB_USER" 8 60 3>&2 2>&1 1>&3)9 t, T; q, ]# H5 a" U# E/ E
- }1 L6 @8 }3 H5 n* G! @) u8 X. Q
- # Exit if cancelled) N" ?2 C* k, s2 z- S/ M
- if [ $? -ne 0 ]; then4 o% F: m; [# j
- Log "DB user name entry cancelled. No modifications have been made to your databases." 1
& e, L" J& u( W# |% | - return 0+ _( d/ j4 n8 S" y, w
- fi( m! }# P6 n! G) K: L; L: ~6 o
. @, T2 }2 e, B# _( Y2 O- # Set the user username if one was specified. K' w* l8 O l" `* V. ^) i8 A
- if [ ! -z "$DB_TMP" ]; then$ s: }& u" Y% [) x& }9 v& j
- DB_USER="$DB_TMP"$ f: E4 j- B; z7 c) K
- fi
+ }+ \, _- G% X. ?; h - . l# P8 R/ K0 D1 H" r2 |: Q
- # Get the database user password
- ]! t6 t8 X3 f8 U; E$ \: k) Z - DB_TMP=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Database User Password" \2 x4 A9 \: l4 l) u! S7 Q
- --passwordbox "Default: $DB_UPW" 8 60 3>&2 2>&1 1>&3)
% e O% w( h$ y' @ - . q! ^ B& K0 \
- # Exit if cancelled5 J' d$ Q8 O" X
- if [ $? -ne 0 ]; then
! R# e' F! }0 g9 Y6 W - Log "DB user PW entry cancelled. No modifications have been made to your databases." 1
9 a- J, `) g2 M$ Z" X/ b - return 0
. i; `+ c7 Y- Z1 M - fi
. d* I0 C0 G. x. f5 v) V
* \- D/ |( B5 _2 N, ~- # Set the user password if one was specified
4 m2 _+ H8 Y1 Q2 ?, x& n - if [ ! -z "$DB_TMP" ]; then
- Z) g, J! G2 w0 {, y& P# ^3 l& O0 D0 M - DB_UPW="$DB_TMP"
1 ]3 m4 p" u' }, H - fi
U9 e, b4 [* l* k) c" T( y/ z5 Z - 8 z* L* K' I! ], U* r
- case "${DB_TYPE}" in1 u& N: f+ o! u* v- U. F, ]
- "0")
+ o6 m, p, P/ E* V - DB_COMMAND="mysql -u ${DB_USER} -p${DB_UPW} "4 b" `) c% S/ M) A
- ;;
3 M" s* p# l9 ^# |6 D1 i; v - "1")
, m6 _+ [/ O1 M; |7 f/ G - printf "Confirm your MySQL password\t, "
+ u3 }( s( r# P( {8 f3 c0 T- r& N - mysql_config_editor set --login-path=local --host=$DB_HOST --port=$DB_PORT --user=$DB_USER --password --skip-warn/ ]! `* V: \9 w3 c7 ?+ h
- DB_COMMAND="mysql --login-path=local -q -s "$ y, U9 r3 o4 j, ?% p
- ;;. N2 D. [1 L% ?; S, B# {) ?8 n
- "2")
+ M4 W: [+ ~ q# t% X ` - Log "Currently not supported." 1
, q5 G3 V: D9 X) L - return 0. x c k0 j6 F9 `
- ;;
, E, ~8 `8 J& W) ?. D$ a - esac
6 ?0 w( m: t: M5 a9 R% \& n" N, [ - % i7 O4 v: \2 P4 t B; D, v7 k
- # Setup database names based on release$ G4 a: i# f: z0 I
- DB_REALM="$DB_PREFIX$DB_REALM"4 f5 z7 S- u) }( [3 I% F' x S/ d
- DB_WORLD="$DB_PREFIX$DB_WORLD"
$ u# S1 _+ _* n8 z - DB_TOONS="$DB_PREFIX$DB_TOONS"
6 D% u( F- ^1 A
% f9 ~4 H5 n2 r/ c9 W- # Install fresh databases if requested
2 ^' Q& u, m2 z; H- j+ G/ N! t - if [ "$DBMODE" = "0" ]; then
/ G3 `# X$ ~ X5 g# k - # Ask which databases to install/reinstall. n; V& i! {: P* z2 n
- DBSEL=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Select Databases" \3 e9 u- I# s. s$ C4 M3 I4 x% S- F0 `; c
- --checklist "Select which databases should be (re)installed" 0 60 4 \9 G/ @1 _" J$ T5 D! U
- 0 "(Re)Install Realm Database" On \
. T# q' p8 I6 X% W - 1 "(Re)Install World Database" On \, [0 }) o5 |0 x' M" a, Q& s0 ?
- 2 "(Re)Install Characters Database" On \
6 }& S6 G9 m" |1 ?+ @0 l# E - 3 "Update the realmlist" On \7 d( ^- y* m* c, v0 I2 w$ v7 k
- 3>&2 2>&1 1>&3)
! c3 O& ^$ y- Y$ G; P8 q: d
, D1 w6 c% H2 Y- # Exit if cancelled* }6 [$ I8 r+ I, H: J P0 G
- if [ $? -ne 0 ]; then7 d/ o, k$ J5 e1 r
- Log "DB selection cancelled. No modifications have been made to your databases." 1
. I. @1 K. \- y - return 0% P3 @( y! f1 f7 r5 }
- fi
- f5 y) V$ C& M3 i d - 9 y: t% l- ]: Z) O! @7 b( J
- # Remove and create the realm DB if selected, n+ M7 k! z9 `2 W# ~) Z% u6 O
- if [[ $DBSEL == *0* ]]; then) M" e! y+ P4 a: y% I- q
- $DB_COMMAND -e "DROP DATABASE IF EXISTS $DB_REALM;"
. F7 G. v: s( P& h9 s! P! ~ - $DB_COMMAND -e "CREATE DATABASE $DB_REALM;"
6 c2 N: Y1 W3 C$ i - fi5 ?2 N1 d$ s' _7 i! d
5 \0 L' X" r& L- # Remove and create the world DB if selected
1 K2 y) a* d* G* s3 R8 _- u; d - if [[ $DBSEL == *1* ]]; then( g) @& F; w$ ^6 |, ~. F( i
- $DB_COMMAND -e "DROP DATABASE IF EXISTS $DB_WORLD;"
7 i8 g5 D* _3 c% e9 f - $DB_COMMAND -e "CREATE DATABASE $DB_WORLD;"
9 [/ Y( o3 p! ?% s9 e& e3 z - fi
3 w5 E: l+ H/ T0 p% J4 ` - 3 P2 h# b9 G' S( ~
- # Remove and create the character DB if selected
1 y3 w1 W! j; @5 n - if [[ $DBSEL == *2* ]]; then# a" V: \' S# f1 ~% v: t) ^
- $DB_COMMAND -e "DROP DATABASE IF EXISTS $DB_TOONS;"( h5 l4 h6 b; p. D5 G; i
- $DB_COMMAND -e "CREATE DATABASE $DB_TOONS;"( Z; g7 t. c" r# \. C3 w
- fi" b2 V. h' Y' N( ]2 M; g! Q
- " t. y( [$ P- C! m
- # Validate success
6 y* ?! s4 t8 W5 m5 W& N - if [ $? -ne 0 ]; then
, x) w; i! G( t( C0 ?; j# s- o - Log "There was an error creating the databases!" 1/ X0 j8 }) k7 D$ y9 |! D: h
- return 1: F& _+ h. m0 h- |
- fi
/ L+ ?) J6 Y: M2 s, {, E3 M
& ~# r9 ]* p1 L% t8 k9 d2 U# ^- # Finally, populate the databases
8 T* c4 r$ O+ H, I: Q/ c# } J/ t - InstallDatabases $DB_HOST $DB_TYPE "$DB_COMMAND" $DB_USER $DB_UPW $DB_REALM $DB_WORLD $DB_TOONS! ^% |- \) h+ s4 x' ~ y3 G
- : l6 y; N# E7 }" C5 |# [- _# n; x+ b
- # Updating the realmlist E% D! |8 O1 S% n
- if [[ $DBSEL == *3* ]]; then
" o0 Q# r7 D1 U) S- m: b - $DB_COMMAND $DB_REALM < $SRCPATH/database/Tools/updateRealm.sql, r2 W5 _1 n' Q/ C* U
- fi
9 J+ @7 R# i$ w6 ?0 r& \4 s - fi1 c/ H' w$ B0 z: i
- 5 G; h; u& N2 l: V
- # Update the databases if requested }- J- X6 O$ x$ P
- if [ "$DBMODE" = "1" ]; then o9 Q5 ~: K: C
- UpdateDatabases $DB_HOST $DB_TYPE "$DB_COMMAND" $DB_USER $DB_UPW $DB_REALM $DB_WORLD $DB_TOONS
; D6 |( e& h7 O$ D. R. i - fi
# P6 ?6 w1 n, d: [. M - }) J6 M* s5 G* I$ ?6 {
- * n2 P3 X3 U+ E: L) o- i! O
- # Function helper to extract resources (mmaps, vmaps, dbc, ...) from the game
' z c" ?+ D4 j# b( [% M' l+ k - function ExtractResources3 m% h. W- X6 n r' W Z
- {
; Q$ z1 J# n( A+ x - INSTGAMEPATH=$(dirname $(find /home -name "WoW.exe"| head -1 2>>/dev/null)); r/ k1 i3 }, i+ V0 _! O
- * e8 y8 R1 l0 Z5 G
- GAMEPATH=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "WoW Game Path" \
! o( o' m6 L, o& g5 A - --inputbox "Please, provide the path to your game directory. Default: $INSTGAMEPATH" 8 60 3>&2 2>&1 1>&3)
4 H" P4 Z Y2 N' D! s - ; m! y& h6 `% h, h, h
- if [ -z "$GAMEPATH" ]; then; Q4 V7 N4 N' a) ~! p8 l8 G( [8 @
- GAMEPATH="$INSTGAMEPATH"6 T9 y, \- j/ M' O/ k; f5 }4 J
- fi
! i& |6 R O. s& w
' G% L* p' O" {- if [ ! -d "$GAMEPATH" ]; then0 l: ~( A0 T, t5 J3 h) w
- Log "There is no game at this location" 1
1 {3 S; E3 h& {( ?3 A) K+ Y - exit 1
+ [' y, B0 V1 D+ w1 G- P) Z - fi
4 I2 O, e- p! }( o! K* w - 2 b" X/ P* P/ e6 e# ` d
- ACTIONS=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Select Tasks" \: c3 Q# a }3 L/ \
- --checklist "Please select the extractions to perform" 0 70 3 \
( L5 R% G$ Y) q- l- F9 f - 1 "DBC and Maps" On \* M* A, i6 ~- V) D: S! }
- 2 "Vmaps" On \
1 d+ h: M6 D' _& k* R, n) {8 S - 3 "Mmaps" On \* G6 C* Z* D5 @% a* g& C
- 3>&2 2>&1 1>&3). J! G: Q. @$ X9 b" N" c. N
; P7 e8 v6 a: m- if [ ! -d "$INSTPATH/bin/tools" ]; then, ^) Y: ]6 l: Z9 w# n! t
- Log "The client tools have not been built, cannot extract data" 1
* A/ q1 R2 u* B$ A3 s$ `1 l - exit 1, u! O! ]" B/ f2 i3 S, h& A0 y
- fi
6 a: K+ w$ f1 Q! c0 q+ o
7 |0 g c- J& s) x& S7 a- #TODO What if DBC are not yet generated ??
1 v: o# b. W1 T0 O, H - if [[ $ACTIONS == *1* ]]; then9 ~1 s! C" L: i& K+ L4 j
- if [ -d "$GAMEPATH/dbc" ]; then! z& t, H2 j" [# e
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "DBC and Maps were already generated" \$ a1 x( L2 X% j, R* N( J# q
- --yesno "Do you want to generate them again?" 8 60
7 K$ L0 ~9 P5 G2 b4 X* h+ k" Y - ; n$ C3 c+ `+ b
- # Check the user's answer4 w5 L/ v( ^1 ^5 z' W) f
- if [ $? -eq 0 ]; then
0 \5 T% U y5 a) j - Log "Deleting DBC and Maps previously generated." 1" q5 s$ m, _' J/ A2 a; F( B* q5 \
- rm -rf "$GAMEPATH/dbc"
% |) f. _: P6 o& s- N - rm -rf "$GAMEPATH/maps" h& I, ~% ]+ b- z" Q: }
- 5 C9 t: c( }9 ^" }) G+ B
- Log "Copying DBC and Maps extractor" 0$ K# n: O* R' ~# Z
- rm -f "$GAMEPATH/map-extractor"
% S4 y) J) |1 K: W# `+ m - cp "$INSTPATH/bin/tools/map-extractor" "$GAMEPATH"& ^2 U3 S3 p+ o# v& j. M
2 i. H# T! \' y6 m) e) O- Log "Extracting DBC and Maps" 0
! T, `5 \" p( n6 F @ - cd "$GAMEPATH"
: \0 x* f$ }3 _# B5 @* z; f - ./map-extractor' v3 m7 z" s% {! k
8 s: E. f) J/ n, t- if [ $? -eq 0 ]; then
5 ]: C/ H, \! t+ i1 j5 K - Log "DBC and Maps are extracted" 0
! Z3 T7 ^2 A2 ]$ \- ~/ N! f+ k - Log "Copying DBC and Maps files to installation directory" 0
6 ]' E/ I: H& C# B0 R8 g i' e - cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"" f2 \) F3 `+ {
- cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
4 v+ q; q" e) }# X' h - rm -rf "$GAMEPATH/map-extractor"
9 V: J3 R- L- _) _ - Log "Changing ownership of the extracted directories"; C! W* h' E; G( h3 [0 v
- chown -R $USER:$USER "$INSTPATH"* q$ j& E) _6 \- t# B3 G% h& g
- else3 T- ?0 `: E7 b& j2 N+ T: l- J
- Log "There was an issue while extracting DBC and Maps!" 1
; k" v& g' B" p ?. f( X4 u; Y7 R - rm -rf "$GAMEPATH/map-extractor"
: M o% t4 b7 y3 X$ f9 m - rm -rf "$GAMEPATH/dbc"
0 N3 R2 o4 B9 H8 f d - rm -rf "$GAMEPATH/maps"' N" L. C6 ~" M7 f. X
- exit 1
7 e* t2 ]1 G; `! `/ ^& k. | - fi
5 _6 p( C5 A! e# n( @ - else
/ U* `/ |/ Z$ c+ U - Log "Copying DBC and Maps files to installation directory" 0* y6 ?9 A% x% W" F
- cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"! B6 r6 p( {$ n `
- cp -R "$GAMEPATH/maps" "$INSTPATH/bin"" Z0 s' O# c( f
- fi$ d$ e: s4 ]4 F5 _& @1 u
- else
7 x& o z) w7 T* D! p+ [ - rm -rf "$GAMEPATH/map-extractor"
5 J/ T) U: f- Y. _+ I* K+ N* Q - cp "$INSTPATH/bin/tools/map-extractor" "$GAMEPATH", {' z6 ?: C9 b7 A: D
- " g3 G) _, x6 _/ y. k# v' d) l
- Log "Extracting DBC and Maps" 0
0 \. j* N( t, j2 R - cd "$GAMEPATH"! Z3 N0 l- y) G- D8 K" r! ]* v+ |
- ./map-extractor6 n; ?; P, H& c3 L* J7 h
L0 i# l# y$ c; _2 i- if [ $? -eq 0 ]; then5 p- b' } f q$ n: h' G! N
- Log "DBC and Maps are extracted" 02 b3 g4 L5 e6 V* E; E6 p" z
- Log "Copying DBC and Maps files to installation directory" 0
- G0 X* N0 C( \4 {& X" H# t# C - cp -R "$GAMEPATH/dbc" "$INSTPATH/bin"7 A& H3 [ r; n- X4 l! z
- cp -R "$GAMEPATH/maps" "$INSTPATH/bin"
# i# b. N6 J* Z1 n. X# j - rm -rf "$GAMEPATH/map-extractor"
+ d9 a. j7 d- L5 C$ G+ m; d - Log "Changing ownership of the extracted directories"
" Z+ N( ?* H& i9 ?. I, M; n* }1 F - chown -R $USER:$USER "$INSTPATH"8 v( ?0 t) v' Z/ E. V9 l4 I
- else' ^8 Q5 K1 s# c* G5 M2 y# e
- Log "There was an issue while extracting DBC and Maps!" 15 E; W7 v! h: Q1 X- {: b# k
- rm -rf "$GAMEPATH/map-extractor". i# ^9 M7 ~: ~! y I |2 x0 B
- rm -rf "$GAMEPATH/dbc"6 u/ g/ a* K& \8 F7 @
- rm -rf "$GAMEPATH/maps"$ E1 x5 x0 v# b
- exit 1
! l* T. T/ f: K - fi
+ s/ b! N& G, T, u$ |" J) Z2 { - fi
5 s) n- A; S4 k& b; N) F( S - fi
$ J+ P* U; H. H4 G8 n& O - : A v; A. f! A; v% j: s. ~; `+ a- |9 a
- if [[ $ACTIONS == *2* ]]; then; g/ g, {, L/ s0 p2 Z
- if [ -d "$GAMEPATH/vmaps" ]; then$ _' g8 H ^6 F9 h/ I6 B/ ?
- $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "VMaps were already generated" \5 S/ q- z6 ]& `' g K/ f
- --yesno "Do you want to generate them again?" 8 60/ I' W3 D+ W$ |+ ?
/ T3 m) m! @% L3 i3 `2 M- # Check the user's answer
f2 V, S; j8 }( q$ H - if [ $? -eq 0 ]; then# h; u, @% B3 g/ Y: a7 j& C
- Log "Deleting VMaps previously generated." 1
. @+ o6 [" w5 ~. s3 b: K9 O - rm -rf $GAMEPATH/vmaps
2 N( r1 V* m) O5 |6 Y6 \, `% Y - Log "Copying VMaps extractor" 0
& }+ y3 H, u- W. E3 K - rm -f "$GAMEPATH/vmap-extractor"
; `" {* m! x$ ], S E3 H - cp "$INSTPATH/bin/tools/vmap-extractor" "$GAMEPATH". ]. w$ d+ N- ^1 r- m- p& C4 ?
. y0 H2 ^/ T( K% I- Log "Extracting VMaps" 0# y' ]: ]7 o8 M8 n5 i
- cd $GAMEPATH
( E) p, Q% a/ v% }4 i; l- V- H, b - # Make sure there is no previous vmaps generation that cause issue.
$ P- N& h, U* f4 H* W. a+ R9 H9 L - rm -rf Buildings3 x3 i( u, g9 ~
- ./vmap-extractor/ Y) o( K8 v, Z# ~* H
# [, T. H- v7 P; Z- F' D- if [ $? -eq 0 ]; then* m3 [4 N( b# Y+ Y0 M
- Log "VMaps are extracted" 09 q& ~0 a4 v0 }8 V/ e* D
- Log "Copying VMaps files to installation directory" 0
8 U) G- F- z/ h& g4 R - cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"
1 Y+ ^- H: b6 c/ ? - rm -rf "$GAMEPATH/vmap-extractor"/ m$ m2 T+ K% f4 D
- Log "Changing ownership of the extracted directories"
) |4 _- F1 m% ~0 u+ n - chown -R $USER:$USER "$INSTPATH"
* y, h- e/ R: P+ K3 i9 `$ K6 r7 y - else" u( G( _+ d4 Y
- Log "There was an issue while extracting VMaps!" 12 B8 L) g+ C# ?7 w' X- s0 m4 D
- rm -rf "$GAMEPATH/vmap-extractor"
; \ e5 Z2 W4 E Z' P; w' f - rm -rf "$GAMEPATH/vmaps"$ I/ S7 a5 z f4 a* P, P
- exit 1( m/ ]* T4 Y( ~5 ]2 S* Y `
- fi
: j; P+ }: | U: [) h8 c - else+ D4 |7 D9 W' ?' @* U+ a# M
- Log "Copying VMaps files to installation directory" 0- I; h" o [6 T5 r$ {
- cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"; b, X9 G( j3 A) n, k
- fi
4 i: H# l$ e+ ~ - else1 J/ b: T2 R/ X% F
- Log "Copying VMaps extractor" 05 l6 o- l7 V, s& {& R
- rm -f "$GAMEPATH/vmap-extractor"
6 N% v- k$ B' ?7 Y" W3 ~ - cp "$INSTPATH/bin/tools/vmap-extractor" "$GAMEPATH"/ f/ s7 V5 I) G+ L9 u% c
9 Y2 _- X- E* z! w- Log "Extracting VMaps" 0
1 l3 l8 s- R x. ~% i% ?. P+ d+ | - cd $GAMEPATH
1 y+ t T! P/ ]. k& V( L - # Make sure there is no previous vmaps generation that cause issue.
9 k$ _- [$ x- `1 o4 |/ ^4 u - rm -rf Buildings; }: g& ?# @- {) V* g3 B
- ./vmap-extractor
: c: b5 K U# D4 |* v2 I3 g; G
6 V, Q7 S+ K x) ?) I2 K$ `- if [ $? -eq 0 ]; then( e7 Z# z# N c; e K) N& M
- Log "VMaps are extracted" 0: X; F7 S* v. J# G/ y& |
- Log "Copying VMaps files to installation directory" 0
4 a- S: b* q# ?9 Z5 M - cp -R "$GAMEPATH/vmaps" "$INSTPATH/bin"0 x7 |3 P1 m' N: C' R
- rm -rf "$GAMEPATH/vmap-extractor"0 q3 P7 Z3 @2 L9 ]+ L
- Log "Changing ownership of the extracted directories". W! E( P- i9 U9 X8 {
- chown -R $USER:$USER "$INSTPATH"7 E \* c$ @2 M& E$ h6 G
- else4 h# ^# R i' o* ~9 ?, ^. p
- Log "There was an issue while extracting VMaps!" 1
$ |5 P, y$ n) ^8 C! l& E [: i - rm -rf "$GAMEPATH/vmap-extractor"
- O9 C, W1 r0 x( h4 }4 Q& W3 t" ] - rm -rf "$GAMEPATH/vmaps"
" q3 D+ q6 A3 X4 k* }( X" r3 S5 G - exit 1
9 p! L% W. x3 E! ]: l - fi; L4 {3 q4 P1 n: G0 z
- fi
" H. ~9 D" o* v - fi
+ j: W0 f! }' f0 n" S - 6 c4 x9 q( @2 U/ j% l
- if [[ $ACTIONS == *3* ]]; then' G) d% U1 B3 \2 g" @8 ?
- if [ ! -d "$GAMEPATH/maps" ]; then X6 h/ C0 n8 ^, o7 j
- Log "Error: maps files must be created to be able to generate MMaps!" 1" ], O6 ^: y* C! W- s
- exit 1
- T9 f0 x; H5 p5 D - fi
7 k' Y3 x' p- X- R3 K4 k6 h - " Z! q# y- R0 Z3 P5 I
- if [ -d "$GAMEPATH/mmaps" ]; then
7 I& H: i- h1 p - $DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "MMaps were already generated" \! N4 {6 L* j4 v, D2 L
- --yesno "Do you want to generate them again?" 8 60
' q" C9 W( h, b" q: `8 ^
3 @& r0 u Y: z3 Q, q2 Z7 U- # Check the user's answer
( z# z# y! b) E. O0 t - if [ $? -eq 0 ]; then& l M; s% x5 T% v
- Log "Deleting MMaps previously generated." 1
/ `* F. B' m# M) }% r0 e2 }) N, ~ - rm -rf $GAMEPATH/mmaps$ T' D9 |0 Z- ]3 c1 f) n
! a6 @# z# J* R$ s8 M7 s- Log "Copying MMaps extractor" 0
% K2 w3 L; w' R* [( R - rm -f "$GAMEPATH/MoveMapGen.sh"
. t) a: r ~" J0 `% J5 J% L - cp "$INSTPATH/bin/tools/MoveMapGen.sh" "$GAMEPATH"
- u1 ^, G/ s6 r: V7 F4 O% j - cp "$INSTPATH/bin/tools/offmesh.txt" "$GAMEPATH"+ w: E+ Z+ o) `
- cp "$INSTPATH/bin/tools/mmap_excluded.txt" "$GAMEPATH"
( ~& v8 A0 }( @8 j& R% \$ o - cp "$INSTPATH/bin/tools/mmap-extractor" "$GAMEPATH"9 o9 E/ D; y& M
/ T { B/ W5 S' a" g$ s8 ~- CPU=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Please provide the number of CPU to be used to generate MMaps (1-4)" \
- e" a- _& |; q8 Q, K: N - --inputbox "Default: 1" 8 80 3>&2 2>&1 1>&3)
$ Q3 y1 h' F7 ~' f, _
+ k) _ W: {' ^: L% d- # User cancelled his choice, set default to 1.% F: |* L- Q7 K" p- X
- if [ $? -ne 0 ]; then
+ ~: `* S% }# H3 S1 n - Log "User selection was cancelled. Max CPU set to 1." 1, C0 F* y0 h. [. [6 }
- CPU=1
8 Z+ a# _. o3 X+ _9 M8 c - fi5 X7 u' [) `2 `1 t8 K9 w; _3 u
- 5 I/ h) I# d6 u, g0 K& A& m2 U
- if [ -z "$CPU" ]; then! l, ~% X- D5 M) |& ]
- Log "User didn't gave any value. Max CPU set to 1." 1) z3 N% m4 U' B" }/ j9 u# }
- CPU=1* m2 M0 B2 u$ L' p# B3 @5 {
- fi
; w8 _: @8 {3 c# X5 E! l& A5 W
1 ^. n: {! R, u5 h- F% S( \9 B- if [ "$CPU" -lt 1 ] || [ "$CPU" -gt 4 ]; then! u& _, ?6 Z" Y7 ~
- Log "User entered invalid value. Max CPU set to 1." 1
# A0 D- e% {- S - CPU=10 ?( t+ j0 e) w2 a# g3 p) M. D* N
- fi
* Y" ^! O& W, n9 M( X& A
) P7 \& V: z a2 @4 W; i- Log "Extracting MMaps" 0
8 U0 \! M* r, G8 D6 e; Z( C: O - cd $GAMEPATH
; @5 ~$ {* f4 F$ e - # Making sure we can execute the script
3 p( I/ F, t1 [: @2 C - chmod 700 MoveMapGen.sh# }3 ^0 i- m M( H5 J& \
- ./MoveMapGen.sh $CPU
6 [, S) n$ q* s7 j - ) S5 O. Q% r$ P4 S
- if [ $? -eq 0 ]; then
. g9 U6 h4 x6 |& B- g& S- N - Log "MMaps are extracted" 0
4 Q5 p4 [6 k+ d, E" l% o1 E$ j - Log "Copying MMaps files to installation directory" 0
8 O7 s& l( k# m+ b6 ~ - cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"
7 N. R! o* {, t) x& a& r) b' b - rm -rf "$GAMEPATH/MoveMapGen.sh"
! d0 r" c" X7 p0 v - rm -rf "$GAMEPATH/offmesh.txt"
( Q. c% l4 m. Y - rm -rf "$GAMEPATH/mmap_excluded.txt"
6 L8 I; E* c6 T# O - rm -rf "$GAMEPATH/mmap-extractor"- g- E0 j5 F: z0 i; [3 H* w% `
- Log "Changing ownership of the extracted directories"
) ~+ e% Q2 s6 r) c, H" W0 Q. L - chown -R $USER:$USER "$INSTPATH") U- }+ @6 p1 ?9 Y: l& l/ Y
- else
$ e7 |" j7 U# o. C e2 ~1 j+ Y0 D - Log "There was an issue while extracting MMaps!" 1, h& A2 T# q0 v1 Y5 V: T
- rm -rf "$GAMEPATH/MoveMapGen.sh"
; R; d( U7 E" v$ m) k3 P4 b& v - rm -rf "$GAMEPATH/mmaps"% \6 F# s$ y/ E8 v
- rm -rf "$GAMEPATH/offmesh.txt"
2 D1 Q P- B, }7 f0 y2 q" e6 \( E& z - rm -rf "$GAMEPATH/mmap_excluded.txt"4 G% {- h( }5 |4 J& L
- rm -rf "$GAMEPATH/mmap-extractor"
5 E$ E8 Z! B4 |+ p, w4 j) X - exit 13 Z- ?: l) t6 U/ C
- fi' t a+ [- B8 C8 K4 [! `# ^
- else9 M, u- ?# ~9 z4 F: k
- Log "Copying MMaps files to installation directory" 0
0 F9 k8 R1 k: G4 z1 N - cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin": P1 }6 I& X: ^* d1 _( ]3 U
- fi
/ ~( l( ^2 G& z' J2 e0 l ^& G - else
# s" N1 O7 s, _ - Log "Copying MMaps extractor" 0
) ?2 p8 S+ w% u, \8 e, I3 n. h. _ - rm -f "$GAMEPATH/MoveMapGen.sh"3 Y2 o: v8 Y) f+ J, [
- cp "$INSTPATH/bin/tools/MoveMapGen.sh" "$GAMEPATH"
2 T, S) m% C; Q' @3 E% ^ - cp "$INSTPATH/bin/tools/offmesh.txt" "$GAMEPATH"
* |) I1 X! {9 W$ M/ c - cp "$INSTPATH/bin/tools/mmap_excluded.txt" "$GAMEPATH"
) \$ Z7 J, \# x1 K& } C - cp "$INSTPATH/bin/tools/mmap-extractor" "$GAMEPATH"
% M+ Q( _, z% |: H v6 d - CPU=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Please provide the number of CPU to be used to generate MMaps (1-4)" \
3 h! s8 u9 P) T" y4 A( y( i# J - --inputbox "Default: 1" 8 80 3>&2 2>&1 1>&3)
' Z5 P1 u! ?7 h. t1 {
/ T" N. b" y2 ?: m- # User cancelled his choice, set default to 1.: @' ~0 u2 `, {. a
- if [ $? -ne 0 ]; then& c5 ]3 K; y* q. @
- Log "User selection was cancelled. Max CPU set to 1." 1
, R/ B# v" C8 Z( B7 U - CPU=15 v- |# y9 x3 F* f! `( a0 O
- fi/ ]. V8 u7 e4 g: s3 I; O2 |
" r/ F% Z6 K: e- A c. x, I7 a- if [ -z "$CPU" ]; then
$ A0 _1 [6 X( B9 r) b' B- S - Log "User didn't gave any value. Max CPU set to 1." 1
- ]% G3 I( _; `$ \9 v8 g - CPU=1* w/ w! ?! e) m% `+ Q8 K A
- fi
* F! U* t6 F- ~% A
& [# u( n4 z3 t% f/ ~; p! L( Y- if [ "$CPU" -lt 1 ] || [ "$CPU" -gt 4 ]; then
% t! N, ]- S. a3 Q5 t7 f - Log "User entered invalid value. Max CPU set to 1." 1
2 T1 |; f5 P* h9 h' u) ~9 L9 Z: S - CPU=1& w& J) n- ]* u
- fi
! e- q% J3 q3 F7 }) s4 {. i - 6 P" ~5 i* S/ a$ b- g# w
- Log "Extracting MMaps" 0
* R5 M+ O% u' C0 Q8 I* I# T- D - cd $GAMEPATH9 s, F p+ _! ^- l! o6 n( G% z
- # Making sure we can execute the script4 ^$ e% S. d ^0 O; [1 V. w0 m
- chmod 700 MoveMapGen.sh5 q: i- H2 a o. ?! W$ P; S
- ./MoveMapGen.sh $CPU; Y$ x& c3 R9 p6 z( \
$ v# H. F" J5 s- if [ $? -eq 0 ]; then
$ i1 @7 E5 x/ p$ a2 `; @1 E - Log "MMaps are extracted" 0% I. m5 A' n9 E! s' S
- Log "Copying MMaps files to installation directory" 0
' ]5 @. E, X) D* U; Y' L+ A S8 N1 x - cp -R "$GAMEPATH/mmaps" "$INSTPATH/bin"6 g D0 J: h7 _" Y2 ]* _/ t; G
- rm -rf "$GAMEPATH/MoveMapGen.sh"
6 C* v1 A; l. q. P; l( k( O, u0 v* w - rm -rf "$GAMEPATH/offmesh.txt"
- f2 Q& H+ t0 `3 N9 ~0 r - rm -rf "$GAMEPATH/mmap_excluded.txt"
' i# @7 j b' W! ^ - rm -rf "$GAMEPATH/mmap-extractor"
5 l! J! k" {* z& z6 r& [8 H* R" n! ? - Log "Changing ownership of the extracted directories"
" h# k$ v6 S# f8 l9 T - chown -R $USER:$USER "$INSTPATH"5 Z4 e' O( E* k
- else
( u. W1 H, C& ?' L. K/ a7 { - Log "There was an issue while extracting MMaps!" 1
2 M1 k, {3 K C- a' r0 ?8 K8 p0 U - rm -rf "$GAMEPATH/MoveMapGen.sh"
5 j) x- m2 @7 Q9 |7 h1 r' w+ `! Z - rm -rf "$GAMEPATH/mmaps"8 N& b7 D( U2 m6 Y9 G1 g7 ^
- rm -rf "$GAMEPATH/offmesh.txt"7 n; r& U, M$ @8 p* [
- rm -rf "$GAMEPATH/mmap_excluded.txt"
* Z) e! e% l0 d% D2 t - rm -rf "$GAMEPATH/mmap-extractor"1 n8 l( u) m* I" f' c- g& @
- exit 1
0 `. \6 K) o, _8 ~ - fi
' ^- P. }8 e% _" } - fi
' U2 A) ^/ K1 [& i5 X7 Z6 m - fi
T1 M- a% |" D - }4 Q" J+ i" P' ]* t+ f$ {
- 5 f6 Q) z# x3 E% J' w8 t. [
- # Function to create a Code::Blocks project* H% @$ R- x8 I; v9 Z, c- [1 K
- function CreateCBProject3 N& d% D0 U. U, l, e/ X
- {: w0 s$ ~7 u; h u
- # Create the dircetory if it does not exist4 o" | x* e5 g6 Q% h& y; G1 q
- if [ ! -d $SRCPATH/server/linux ]; then
7 o/ b/ u2 `. \- A) a4 s - mkdir $SRCPATH/server/linux2 A! H' e( d, Z! G S# m8 S
- fi
) ^1 X) s2 t% b) x5 D l
3 X& C2 Z/ i. j0 J- # Now create the C::B project \! n- L' H% R+ m# Y0 \. E
- cd $SRCPATH/server/linux
/ S0 j9 x/ E7 y: z7 D - # make sure we are using the cmake3( w; \, U$ k- K) _- e4 ~$ m
- UseCmake3
% z* _' P+ {9 o4 T - $CMAKE_CMD .. -G "CodeBlocks - Unix Makefiles") }- U3 Y, n2 A( l5 \; p9 s
- }
$ P- h7 L. E L E - ( \% A5 t1 H* ~) _ u3 c6 b+ j
- - X0 o$ c* E O+ b) d/ X/ a
- . G0 d% E: N! q3 U2 U* G- E
- # Prepare the log, \/ p1 w1 r- L, \, x. Z+ F
- Log "+------------------------------------------------------------------------------+" 0. m# f0 p: h! g) @* n+ Q; D9 G
- Log "| MaNGOS Configuration Script |" 0
/ Z2 A+ N( [" @) k! n$ { @% y - Log "| Written By: Ryan Ashley |" 0& v; { k. g4 `% G* ^( x9 j
- Log "| Updated By: Cedric Servais |" 0
" N4 Y2 Y u* [ - Log "+------------------------------------------------------------------------------+" 0
% v- ~: E8 E3 k, {
) y0 F; R! S' `8 w0 d- e- # Check if user who is running this is root
( i6 D( L1 u$ q ?0 z - CheckRoot. l: B0 a7 U4 i2 [* x
+ O' _6 J: V$ o8 |* ]7 s' B- # Select which dialog to use
. U$ R2 k" g8 B; J# \" d* e - UseDialog7 T! {4 y9 }7 f: {
" P2 f% R" O. `( J- ~4 h5 s6 p5 @- # Select which activities to do9 K$ l( S/ R w* I1 i, ]$ c+ Q0 U% B/ P6 O
- TASKS=$($DLGAPP --backtitle "MaNGOS Linux Build Configuration" --title "Select Tasks" \
+ c- f! D: y# {8 i+ o - --checklist "Please select the tasks to perform" 0 70 8 \
' K$ H$ R( `- U% _1 T - 1 "Install Prerequisites" On \8 v" z6 K, \3 I) M# {
- 2 "Set Download And Install Paths" On \2 o* o8 Z4 ? h# O: m& L& y9 L
- 3 "Clone Source Repositories" On \
& r) a) {1 x0 C$ M - 4 "Build MaNGOS" On \4 y) z2 t4 k- [% Z2 t
- 5 "Install MaNGOS" On \
* c" A7 C8 x! e - 6 "Install Databases" On \* P* g$ w% G- W6 v
- 7 "Extract Resources" On \& h2 P0 Y7 z9 k+ F
- 8 "Create Code::Blocks Project File" Off \) S9 U5 s5 l4 }5 p, ^# K
- 3>&2 2>&1 1>&3)+ S4 P$ A, T5 _7 O: {- x: R& l
! @& w0 {9 i9 E" f- # Verify that the options were selected' B$ u; o( W& H2 e7 U
- if [ $? -ne 0 ]; then, a! c( P- v) e$ t1 S
- Log "All operations cancelled. Exiting." 18 ~0 m, ~$ k8 q) L) [8 [3 i& d$ ]
- exit 04 R$ `4 F0 X* @. `3 a9 r) N
- fi
7 Z7 x5 @# X( o( E) W
3 _5 a6 u& r* U+ l! Y. r- # Install prerequisites?* }, k! Y, R9 _) s( _" ]" q) {
- if [[ $TASKS == *1* ]]; then6 r1 s$ E+ f2 n$ u
- GetPrerequisites9 v& b0 |/ O+ A; S
- fi- O- e: i+ J8 Q& _
6 @# `+ O" c G a. d# w0 D- # Select release and set paths?( Z$ A/ C9 \& w6 H6 D( D: K! L& m
- if [[ $TASKS == *2* ]] || [[ $TASKS == *3* ]] || [[ $TASKS == *4* ]] || [[ $TASKS == *5* ]] || [[ $TASKS == *7* ]]; then
1 Z5 G! y9 y4 }/ @) K - GetUser
; l$ T7 O4 x/ p0 d+ D! {- c0 l9 A - GetRelease0 w j! n# [- h# _3 M6 c2 m F. |
- fi
% D! a, `# ?% A6 y# N
3 P8 W) C, E& y1 }# `- if [[ $TASKS == *2* ]] || [[ $TASKS == *3* ]] || [[ $TASKS == *4* ]] || [[ $TASKS == *5* ]] || [[ $TASKS == *6* ]] || [[ $TASKS == *7* ]]; then8 A1 }4 s2 O; V9 ], |: q7 C
- GetPaths
6 N8 E( l" B& Y0 Y- y - fi
% { T* \% p5 r# e, z K7 e - 7 e6 U* Z3 n* v1 m3 E) r7 q( m% l
- # Clone repos?
9 L% c- u& g+ q8 T - if [[ $TASKS == *3* ]]; then. M% P. N' V! Q0 ?" J# @
- GetMangos, Z) u5 v3 X, f; G) J3 g
- fi \* f3 O2 e0 R
" R1 v0 k8 v7 `" t! Q1 g- # Build MaNGOS?4 l" L. ^' M3 R2 f! c. ~8 e4 x5 d
- if [[ $TASKS == *4* ]]; then4 {9 n; Z: I, g: M7 L) v$ N2 |4 Z
- GetBuildOptions
( W4 f/ z5 @( G2 V1 d' H/ Q - BuildMaNGOS7 G/ A; a: M+ E1 ^/ ~7 a3 m
- fi
2 y7 i9 F0 s0 t4 X - ! Z/ q5 p6 o$ Y. c* h
- # Install MaNGOS?
1 c0 `3 v0 S( A* u6 @ - if [[ $TASKS == *5* ]]; then" S: ?5 B v7 r1 b A8 K
- InstallMaNGOS- K8 g: @9 K+ D0 ]
- fi
3 f0 b( \; F1 k- x- T1 d! s& T
' A+ A. C i/ }; B, f* s# z- # Install databases?
+ H9 z. z/ P6 G4 o6 C8 G" i ` - if [[ $TASKS == *6* ]]; then
9 B4 \% }/ e* v- G4 j9 b, F - HandleDatabases! n' d2 v2 F2 R
- fi: s; O; ^" ~$ C# b# D3 h
- , V$ v0 J6 e# W* f( W
- # Extract resources from the game?
/ n7 H' \4 ^2 j - if [[ $TASKS == *7* ]]; then
9 H; _4 E9 F, N7 S' W - ExtractResources1 Q7 r e! S! w7 {9 P
- fi
6 \# V- i' Y' s j$ Q
' w. g5 i1 D5 }- # Create C::B project?9 H4 n5 P4 U" S9 R* q
- if [[ $TASKS == *8* ]]; then' j Z( ~/ r+ t
- CreateCBProject
3 ?# M+ L! g( E3 K7 s6 f) B - fi
- K0 @. b8 J! g% J! R P
- K2 C2 Z/ v' o! a( u( H/ ?- # If one of these actions has been performed, then we know the user.9 v, u N2 Z9 D4 c
- if [[ $TASKS == *2* ]] || [[ $TASKS == *3* ]] || [[ $TASKS == *4* ]] || [[ $TASKS == *5* ]] || [[ $TASKS == *7* ]]; then r3 x; I. {8 B1 A
- Log "Changing ownership of the extracted directories" 11 t9 H G. y$ u
- chown -R $USER:$USER "$INSTPATH"+ [, G0 C; M* v* w
- fi
# }. J4 O+ J7 @$ P! o
% _% U! D4 |5 H5 v& u* ~- # Display the end message
8 h# i6 |& n6 @% a( @" a3 {. O+ Z5 _! S - echo% R3 x X, y7 C% k0 C( z# Z7 Y0 c
- echo "================================================================================"
3 I! }' Q" }3 p4 O5 b' E; W: } - echo "The selected tasks have been completed. If you built or installed Mangos, please" W) B7 t; @) e* }
- echo "edit your configuration files to use the database you configured for your MaNGOS"
9 |) j7 s! R0 C7 B6 p' R - echo "server. If you have not configured your databases yet, please do so before"
: ^7 ~3 ^3 y1 _; ~& u - echo "starting your server for the first time."6 B0 |" |# H0 y1 N: `" K/ L
- echo "================================================================================"
) t- v# i2 [3 M8 E9 N - exit 0
复制代码- wget -c https://raw.githubusercontent.com/mangostwo/database/master/InstallDatabases.sh && bash InstallDatabases.sh
复制代码- #!/bin/sh4 I( d% i4 N- [& W0 H# O
- ##############################################################################4 M( p" c6 T6 v: b- j5 v
- # This utility assist you in setting up your mangos database. #/ m- Q6 @" m3 D: e
- # This is a port of InstallDatabases.bat written by Antz for Windows #
% y2 I7 G2 R; f# | - # #' W! ^* P: Q2 s! P( g' t
- ##############################################################################6 x+ l+ [4 \- _: X
- 2 Z' r9 W3 I: T: X% S0 n7 E; H
- OLDRELEASE="Rel21"
0 [' n8 x: J- k7 B - RELEASE="Rel22"$ g. i# p. _# U7 h5 {
- DUMP="NO"
; Z) l/ A. q) w
1 A$ r" `! \& I* N: j- dbname=""
+ v+ e3 K: Y" l# U5 D( z: } - dbcommand=""
# o; L7 L( ]$ V3 P5 N - 7 H I* l3 \5 u# {9 X
- createcharDB="YES"
( t5 f% G( T1 g5 { - createworldDB="YES". g- A! p' u; |
- createrealmDB="YES"
: @3 Q, ], ~1 D+ y& E& O( G - 9 Z! R a \$ _0 {
- loadcharDB="YES"
4 A. S) N+ ]; S( r& \8 r0 @- K5 [ - loadworldDB="YES"$ W- g5 l1 y3 f$ G, m' `# f
- loadrealmDB="YES"+ W4 Q8 I4 t U( |
- dbType="POPULATED"
: e5 V+ h& Y+ w* k
" g4 _. g) i* `* O- updatecharDB="YES": M3 }6 ]* O, T
- updateworldDB="YES"
& t" ?6 L0 I u - updaterealmDB="YES"& {3 \& k; f# D
2 y+ }5 d/ e" p( q* G: a: n+ @; \$ D- addRealmList="YES"& H( M& K! Z0 O; L% {
9 e0 m7 }5 C3 {4 h+ e$ `4 q* a- svr_def="localhost"0 f6 G% D) z' }0 m! z9 X1 E
- user_def="mangos"
6 o$ ]0 U: d$ q# f) T; v - pass_def="mangos"6 l' b; y' ]0 ~+ l4 ?
- port_def="3306"
' K+ }3 ~; s0 v+ t7 t3 [8 X" h9 V" Z - wdb_def="mangos2"" w2 O: x* |& `$ O: a- E2 I+ ~
- cdb_def="character2"0 P/ z' @) o$ j* ?& d( D& i- ?
- rdb_def="realmd"+ s0 a+ g' B& E. T, D+ a& P: P+ ?" h
6 i& V. Y g6 T- printHelp()
$ O* a' p4 T8 Q. Y* i* z. M - {) r9 `- C8 O3 h+ c7 H
- printf "Usage: $0 [-s] [-u] [-d] [-h]\n") E% p4 H% R6 D& b1 v# A% w
- printf "\t-s: Run this script in silent mode, only prompt for the database information\n"
" a5 b/ _/ c) @; | - printf "\t-u: Run only the updates of the database\n". U% q! C+ a/ r+ F4 {) U6 W
- printf "\t-d: Dump the database configuration into the home directory of the user\n"( c$ A! r; f. s. g% f* p
- printf "\t-h: Display this help\n"0 H' h5 ~, o9 W X. P- h a# g' U
- }* s) h$ v+ M6 f4 c3 q7 D
- . s) n) Y) ?9 I o
- printBanner()
0 j5 l9 w9 l i) o1 b# z - {
n9 |- P' {: ^4 t - clear" t, P! T" X2 t- ]9 q
- printf " # # # # # ### ### #### \n"( D' M! n6 C; T( ]( h
- printf " ## ## # # ## # # # # # \n"9 [2 v. V3 u+ \6 w/ P
- printf " # # # # # # # # # # ### # # ### \n"
" c* ]+ K! G, ]8 ~7 Q - printf " # # # ####### # ## # # # # # \n"
& H; g, j8 T, ]" K: g p - printf " # # # # # # ### ### #### \n"
9 r- X2 [& Y/ S0 [% ^, k - printf "\n"
' V- ~" p m" [0 E" q' d! P1 S - printf " Database Setup and World Loader v0.03 \n"
( j+ P7 p0 W9 Z( t; `* n2 i# | - printf " ---------------------------------------------- \n"
# X6 B" X/ X" _9 E% a* Z N; j$ _ - printf " Website / Forum / Wiki : https://getmangos.eu \n"7 X, s6 L( k( x5 }# u
- printf " ---------------------------------------------- \n") i0 ?$ M5 ?- `4 s! V0 }
- printf "\n"
6 n( l/ d' k: l - printf "\n"3 {! f- O6 B& e3 Z8 p( W/ U0 A
- }. R! K9 k- h0 }
; R9 X" c. p* B; b4 A- printActivities()
f3 U& S$ z# P1 w3 x0 @1 e, I' O* D1 \ - {) O2 x9 K" e# U6 H
- printf "\tCharacter Database : \tV - Toggle Create DB (${createcharDB}) \n"' Y5 ]* N1 X5 H/ B; i
- printf "\t\t\t\tC - Toggle Create Structure (${loadcharDB}) \n"$ r6 l( |7 P) l7 s) K) u8 w
- printf "\t\t\t\tB - Apply Character DB updates (${updatecharDB})\n"
9 u0 ?3 ]0 b+ o& ~' S1 [ - printf "\n"( w$ I- v4 ^2 [* C; @
- printf "\t World Database : \tE - Toggle Create DB (${createworldDB}) \n") n9 x# [- O. \5 ?& s
- printf "\t\t\t\tW - Toggle Create Structure (${loadworldDB}) \n"
0 F+ d9 D T) C! V - if [ "${loadworldDB}" = "YES" ]; then# o. P$ v' J6 w6 U5 s* m
- printf "\t\t\t\tD - Toggle World Type (${dbType})\n"( ^8 c2 ^5 Z0 o6 `
- fi
% d( j% Y# L4 a( j - printf "\t\t\t\tU - Apply World DB updates (${updateworldDB})\n"
: e5 ?6 m& Q; s7 K+ e4 { - printf "\n"0 ]5 P: j: c1 f7 \" A1 e
- printf "\t Realm Database : \tT - Toggle Create DB (${createrealmDB})\n". d* B; @5 X+ R; Q& G. g
- printf "\t\t\t\tR - Toggle Create Structure (${loadrealmDB})\n"
6 t. d3 h- @0 G" J8 I/ f - printf "\t\t\t\tY - Apply Realm DB updates (${updaterealmDB})\n"
: V! G- d, e" G' ?/ N( X3 { - printf "\t\t\t\tL - Toggle Add RealmList Entry (${addRealmList})\n"
H/ \/ Z* g3 s* v9 {! P - printf "\n"
- H9 s' |( [' g" G3 C' J - printf "\t\t\t\tN - Next Step\n"8 b; d" n; S5 A3 C4 m% H
- printf "\t\t\t\tX - Exit\n"# J+ T V9 g; H& o7 E$ U5 G
- }/ f* W- R* b- o
5 h$ t9 W/ n S i- determineDBName()
. ~/ h* l3 J" B3 G" X; G9 \8 V+ L: ]3 X - {# s% C, v5 M+ |0 l0 {! J
- if [ $(which mariadb) ]; then
2 h/ I; z: z; i1 F' ] - printf "MariaDB found.\n"
; x# {5 V9 V1 w& C0 u - dbname="MariaDB"
! l& ?6 |! w% N - elif [ $(which mysql) ]; then* D" p7 f) K* P# e+ j( r
- printf "MySQL found.\n"9 x! ~* p7 o& k8 x( V3 ]/ G' e
- dbname="MySQL"
5 M; u$ ^& U0 } - else8 ?# T$ j9 B2 ]) a5 S- _
- printf "Did not find mariadb or mysql.\n"# J+ N! `8 F* _' X2 n' P" J( ?
- fi
% c- l+ } z5 F# G - }1 v$ K, J6 N' g' [$ @
- 3 I: g: ~; |4 f1 I* B
- mysqlconfigeditor()
+ t0 q% `4 C, K+ i - {
r7 K& q# z9 `3 E( [! i - dbconfig="mysql_config_editor set --login-path=local --host=${svr} --port=${port} --user=${user} --password --skip-warn"8 R V5 f% k+ R6 Z& G
- }
& x) s+ m5 q1 o! n' n7 E: X; x - " C2 L+ E8 M! L/ x* u
- determineDBCommand()
& K j) e' J) K) ?- }" B - {; K8 v) Q& Z, R$ i$ L; I% m
- if [ $dbname = "MariaDB" ]; then
, z5 T) p* c/ Z2 z6 k) c g! n- _" @ - dbcommand="mariadb -h ${svr} -u ${user} -p${pass} -q -s"
8 a( s2 Y" m, C* q1 y - elif [ $dbname = "MySQL" ]; then
1 I. ?- ?5 ?4 C8 u4 m3 O - dbcommand="mysql --login-path=local -q -s"
" r* o( S+ ^7 \' ~0 I - else
$ ^8 ?" [! @; u9 J" ^ Y - printf "Did not find mariadb or mysql.\n"- B8 r1 M; e; ]* _( b+ I7 q
- fi1 s1 ]5 r5 h( D/ g- w9 G' p' K
- }
+ K: {! {& z" I$ _' v9 Q
* h: k& S+ o: A1 W& I* }6 T; M- createCharDB()
& r/ k$ I! x! E3 y) { - {& A" k0 M2 {9 r
- printf "Creating Character database ${cdb}\n"
3 W/ |1 Y* G- @ - $(${dbcommand} -e "Create database ${cdb}")( m/ e* Q- k/ c" c+ \
- ) |9 [( f4 ~5 r9 |1 |: V6 j0 m
- if [ "${loadcharDB}" = "YES" ]; then @% M) k, J! W& T
- loadCharDB
- [# O6 Q4 b1 K- w4 r - fi
* [+ j8 p2 j, ~; f1 @+ u* K3 U - }
/ @$ R, p, z6 o: W6 P - T# o1 X6 g; k% ]- ~$ I& ?
- loadCharDB()
7 b" f6 E) K8 V- G: ]' P - {2 W9 L2 M7 ]- B( r
- printf "Loading data into character database ${cdb}\n"( S$ w* {$ G8 l, q. F. K; C2 g+ x' Q
- $(${dbcommand} ${cdb} < Character/Setup/characterLoadDB.sql)
" L+ k9 ]* k& a* f6 K, k' v9 @ - 5 c4 b# h6 K, q6 b; O
- if [ "${updatecharDB}" = "YES" ]; then
" J2 ]$ T# `% R' `/ f - updateCharDB, b1 H* \5 } Z' r. ^* n! u, n( y
- fi% `( y: P! u y" |- g
- }
" X9 k O* `- R) Y7 O; j6 A: T& p6 _
! H1 [) Q. g4 {9 M! n- updateCharDB()8 B1 u& F9 N9 D; ]
- {% r" h. Y1 S: N5 B& I" Z
- printf "Updating data into the character database ${cdb}\n"5 k! {2 @! v* T* k! l9 T
- for file in $(ls Character/Updates/${OLDRELEASE}/*.sql | tr ' ' '|' | tr '\n' ' ')" Y4 \- V! o& d( O1 q# x
- do
. E& z: \: i( W( y* n g% ^! ? - file=$(echo ${file} | tr '|' ' ')
# f8 z' {7 _/ ^; ~1 E/ w - printf "Applying update ${file}\n"+ C+ l0 d3 X0 a
- ${dbcommand} "${cdb}" < "${file}"
7 k7 W+ D/ @# n: W - printf "File ${file} imported\n"' S( Q1 W2 s( `
- done
% S% Q: Z& S, ^3 Z! W - - D$ a/ E* E$ P. N
- for file in $(ls Character/Updates/${RELEASE}/*.sql | tr ' ' '|' | tr '\n' ' ')
! i: O1 }, z+ [9 K - do
. c/ Q. h2 G- z8 _3 C# g - file=$(echo ${file} | tr '|' ' ')
1 s, K5 t% O( i2 E. P - printf "Applying update ${file}\n"
5 x( t- d3 k. p' d9 w5 e( g8 ` - ${dbcommand} "${cdb}" < "${file}"2 m6 D) ]3 g9 T% Z
- printf "File ${file} imported\n"
* m( \5 z1 n5 c! Z% A' b9 B - done: E( Y; K' ]. o) k, ~& N
- }0 }; `/ F' Q+ B$ K; u
! \9 `' g3 Q6 o, Q. `" I8 U& }- createWorldDB()
7 W3 Q1 k# \$ K2 b* z7 e( J6 f- U - {$ K" D+ Y+ r, Q% v" x9 a8 s, Y
- printf "Creating World database ${wdb}\n"3 U+ }% P3 s! k% A, ~6 a1 b
- $(${dbcommand} -e "Create database ${wdb}")
9 U# M; E# P9 ^
" d% I/ }8 l `# J/ D- if [ "${loadworldDB}" = "YES" ]; then6 \1 }1 d# D( H Y4 M( t$ H+ R
- loadWorldDB
9 M. v* O. f. }' q: r+ b - fi
+ t+ x# \+ D) n - }
- {8 e. T: Q: c
5 Q8 `1 H. c# Y! V+ H' D- Q2 O- loadWorldDB()6 ^5 k! d. O3 s. u
- {
( q' Y/ n1 t: T( ? - printf "Loading data into world database ${wdb}\n"
6 H E V9 \! y/ q9 Y - $(${dbcommand} ${wdb} < World/Setup/mangosdLoadDB.sql)) ]; K' R( G2 d1 U8 B
- 5 b- K! H( d/ E# a9 f( X0 A; ~
- if [ "${dbType}" = "POPULATED" ]; then% G+ L- u; g3 }" h9 g, C6 s
- populateWorldDB- ]' C" q* c. Y8 K( h1 Q$ L1 ]1 |
- fi
% F1 ]5 `& ], j, ?+ n9 w, @ - }% E1 o. e& S1 G# b- D
6 _( Z `4 {+ f# V* K. g- populateWorldDB()
+ R) D- m. m% Z6 o' W1 h, V2 c3 f - {8 l0 s- a l- H; R# B
- printf "Importing World database ${wdb}\n"
+ L, _0 V' w6 a; C+ O' g - for file in $(ls World/Setup/FullDB/${OLDRELEASE}/*.sql | tr ' ' '|' | tr '\n' ' ') " q9 V9 c7 f0 M
- do/ `7 y& N+ P* ]9 G1 D& l
- file=$(echo ${file} | tr '|' ' ')
. y/ P# {/ E/ m, p, | - printf "Importing file ${file}\n"3 X- I( s) |$ W$ G# D) J! A9 l
- $(${dbcommand} ${wdb} < ${file})6 D+ Y. o$ g+ {4 G
- printf "File ${file} imported\n"
/ q/ N i( z$ ?9 R - done
: L" e+ ]6 c' Y& e' P - ! w% ^" P( m( D: ^% ?
- for file in $(ls World/Setup/FullDB/*.sql | tr ' ' '|' | tr '\n' ' ') 2 R( V: }: p: {: S( Q
- do
6 _; u1 ]7 u! T2 W6 \$ l4 n - file=$(echo ${file} | tr '|' ' ')
; I; C2 F9 X- h5 ~9 R - printf "Importing file ${file}\n") l" X. M8 C# }
- $(${dbcommand} ${wdb} < ${file})8 R: p$ a4 d! m
- printf "File ${file} imported\n": i. K4 x( o# j" I
- done
1 c7 n0 c% ^& \% A - }/ r4 n' y$ {/ l* @
- ) K7 z% B6 h& C7 {" Y
- updateWorldDB()( T3 O7 H/ H& d* V9 J" ~1 l) {7 ?
- {) O4 [5 d, Z! V# \+ w+ ], a. b+ l
- printf "Updating data into the World database ${wdb}\n", r! I0 _! e) g0 N7 }
- for file in World/Updates/${OLDRELEASE}/*.sql9 `# q. J+ s& j& O5 K& r
- do' j8 U( H3 d0 B. k( Q4 c* X# H
- printf "Applying update ${file}\n"- j$ Z$ W' |! M8 I5 m3 F; t
- ${dbcommand} "${wdb}" < "${file}"7 e" F. d8 i% A$ ^: i8 Q
- printf "File ${file} imported\n"
0 m% I# X" p! n a/ h% L - done! m, j$ U/ w" [3 G$ Z- E" q4 f
- ! D* U0 }( f/ B
- for file in World/Updates/${RELEASE}/*.sql
7 w+ h. K2 |( q! H( b' Z - do) i# v, g$ D5 B4 a+ }
- printf "Applying update ${file}\n"
! P% F- } c) `! ]' q8 Z9 b - ${dbcommand} "${wdb}" < "${file}"7 a/ z2 Y V5 [" H; \
- printf "File ${file} imported\n"4 ?7 k8 v2 T$ i( u1 j6 r, V
- done
: X! \0 n$ [, S! v8 v0 n6 m4 n - }
j% C/ r; L% a$ y; P - 7 v! x0 w' a$ N3 t
- createRealmDB()
g/ s( D. _+ L1 A - {
6 q: Q$ f& z2 m1 s& N( k% P - printf "Creating realm database ${rdb}\n"& x& F+ B e2 ^+ Q. ~ K
- $(${dbcommand} -e "Create database ${rdb}")$ p- }# Q- ]; ^) a6 L
) v8 p) }* l0 C( {2 N- if [ "${loadrealmDB}" = "YES" ]; then* c: J/ P& Y1 N, c' g% ]
- loadRealmDB
+ N; I) j R9 C - fi! [. C9 U) H9 s5 ?9 b& ]
- }/ E+ T' ? m* }" y" [
- & `0 c4 Z6 F" {- M9 Z( c! w* Q3 J
- loadRealmDB()+ ]- Q2 \0 q- O. P2 y8 Z
- {
! o9 O: v' m# {! H9 o1 w( q. G - printf "Loading data into realm database ${rdb}\n" 9 v9 ^( E1 a$ l
- $(${dbcommand} ${rdb} < Realm/Setup/realmdLoadDB.sql)
1 e4 F; p* A6 `. n" y- s5 T0 j - }4 ~. T9 r& Z; X
5 _, t0 s, I7 N" o3 c: Z1 p- updateRealmDB()
. {$ d: z u; V( h6 R$ P6 M& C - {' Y. F, M. R7 R& s0 E r* k% c5 z( |
- printf "Updating data into the Realm database ${rdb}\n"0 Y- e/ Y4 }1 ]0 `; U. m) _
- for file in $(ls Realm/Updates/${OLDRELEASE}/*.sql | tr ' ' '|' | tr '\n' ' '). p$ k7 x3 G4 ?: ~& ^
- do
* n: l' z- {: N2 H - file=$(echo ${file} | tr '|' ' ')! c$ P; I7 P8 W5 i
- printf "Applying update ${file}\n"
% V- s6 F0 {0 k/ s) D% |# l1 i - $(${dbcommand} ${rdb} < ${file})
* m ~( X- X4 o3 b# g: N$ } - printf "File ${file} imported\n"
4 G, `/ h; q' y; q. {/ `2 w - done
4 l3 X' h; q( S
" v! l4 y) X7 ]5 }* p" `& n- for file in $(ls Realm/Updates/${RELEASE}/*.sql | tr ' ' '|' | tr '\n' ' ')6 L6 N; E4 B R3 t
- do9 o9 @. U% D3 H; F" C
- file=$(echo ${file} | tr '|' ' ')! @7 y0 z+ v( K6 j# a$ N# ?! `
- printf "Applying update ${file}\n"
0 H+ Q5 ~5 |- J3 K. } - $(${dbcommand} ${rdb} < ${file})7 f& ^* g- n( x1 z+ q
- printf "File ${file} imported\n"5 _8 C3 {& f* C+ ^! T
- done
/ {# }1 j; p0 V - }
7 Z% P" [" ^9 J( F& s
* c) F# V% P$ T- addRealmList()7 h( b8 F: W9 S8 b
- {
3 i- T6 A. b8 \; q6 p7 f7 B% @ - printf "Adding realm list entries\n"0 O& k5 f( @' L z
- $(${dbcommand} ${rdb} < Tools/updateRealm.sql)
) @! x; w; n* ]- T4 U - }
& s3 V- _! t+ q. L5 l! d7 Z
8 k5 @ V( f) \6 R- activity=""4 X) p7 M7 M; f* f
- % c% v7 p! m. f
- while getopts "suh" o; do
9 d1 }" p9 r% s - case "${o}" in2 l. F B/ s0 K% r2 d
- s)
7 n0 I- I5 t T; g2 ? - activity="N"% w+ I6 z) ~1 j% d! {8 ?
- printf "You selected silent mode\n"
! `5 D9 X1 f2 j - ;;
) `: [1 b4 N4 s' k" p4 O - u), \! M& w5 p) t5 z: F
- createcharDB="NO"! \/ p" s8 z: z' k! M
- createworldDB="NO"6 _7 p- t2 M$ ~
- createrealmDB="NO": {1 ]7 l% c# n! b! O( Z
( S k: Z. ]6 P$ O! K- loadcharDB="NO"9 J8 m# @0 R* |9 d4 R
- loadworldDB="NO"
: l( J/ s5 L R1 m' G/ R - loadrealmDB="NO"/ Z, j/ I9 ?/ F% j* j/ B
- dbType="EMPTY"
+ a/ B7 A+ _$ V! J - printf "You selected update only\n") U' v# j8 P/ N
- ;;# U% ^" B1 f( S* V
- d)
- [3 E- p b8 { - DUMP="YES"
$ J) X$ l' S% C7 E; D - ;;
- K6 H* _. k! N - h)8 o" R/ y/ e [' g& P" Q
- printHelp
3 y8 |" G7 |# u) V# e - exit 0
; n3 o2 y$ Q; K( h+ Z - ;;
& C1 L a% ^1 v" ]6 q - esac
+ H3 R. P. H1 O( c. } - done* w% `2 G1 l% P; L
, ?& J) h3 v7 ^2 j- while [ -z "${activity}" ] || [ "${activity}" != "N" ]
H& I/ G5 N$ k" L# }5 B - do2 j4 P9 R0 P: g. ^9 o
- printBanner }% i# u+ b7 D, P$ g( z- f
- printActivities0 f+ f0 d3 W q3 z. Y
- printf "Please select an activity : "8 g/ W8 P( ?* j$ i D- ]# p
- read activity
/ P- m3 j& x- D' i0 U9 y - activity=$(echo ${activity} | tr '[:lower:]' '[:upper:]' )( _3 L3 N( t* I( o7 e
- case ${activity} in
1 z; b- j/ N0 O- Z - "V")
4 W. E4 E [7 A* t - if [ "${createcharDB}" = "YES" ]; then
( K, N2 }: i( j! _; Q - createcharDB="NO"' m( }4 |- u d1 R; \! l
- else . a6 a+ f9 c& f
- createcharDB="YES"
- b: V9 \" K- n* k - fi
: {. z* j! f; F* d - ;;1 C: M" x j4 B4 _6 d( Q7 g) g) a* e
- "C")
+ K7 n u+ I) w; x- S - if [ "${loadcharDB}" = "YES" ]; then
) [, D: A! a' L) N/ L+ y. V! P - loadcharDB="NO"
: ^: C' b: s4 |0 a% @" a8 M7 E - else ) ^' y* U$ e0 _; U7 Q- _* s
- loadcharDB="YES"2 @ o$ t+ Y- k7 R9 b
- fi: t* V: G: e$ H, }0 G& t2 P
- ;;
9 c* e3 T3 b1 a% [/ O - "B")
5 h0 k! K) n9 E7 J - if [ "${updatecharDB}" = "YES" ]; then
0 X& M+ i4 y, A" r - updatecharDB="NO"; C+ ?- |- K) R* T k/ |
- else " z5 B7 Y2 }& n, L. G/ O
- updatecharDB="YES"% A9 J6 k. n) b. V/ _
- fi9 B. c# \+ y1 ^
- ;;' T6 J& H* B9 ]3 ]1 n
- "E")
) \8 ]2 U5 h( ?/ t7 y( W2 j - if [ "${createworldDB}" = "YES" ]; then
4 S8 O7 x3 I9 c" q& A8 | - createworldDB="NO"+ L1 r0 z2 Q1 V. N# T
- else + {/ } v4 _7 s* R
- createworldDB="YES"
7 u" l- z( Q8 V: o) f4 e7 Y$ ]* ^% b - fi 7 o7 F9 i4 c2 I1 s- ?8 ]- Z
- ;;! V+ a8 b7 ^$ d2 e4 [
- "W"): K8 `; j9 C9 `
- if [ "${loadworldDB}" = "YES" ]; then
( B! V _. A y0 l3 c. t+ T - loadworldDB="NO"
3 E- m0 J" F2 \/ W - else $ U. o0 W" X" g5 r3 ^# h/ U
- loadworldDB="YES"
: @3 l0 m; E7 r) Z3 V - fi " `/ `1 \" P7 K$ e+ X5 V
- ;;$ k2 w7 y5 Q2 l/ K0 N; w! u: e
- "D")$ f. m2 l- h* V" H* E. O
- if [ "${dbType}" = "POPULATED" ]; then
2 Z7 v/ ] W$ X% x9 O. y - dbType="EMPTY"
- n5 X5 ]$ Q! D% ]6 d$ Z - else / u6 k) }0 w7 v( Q/ C* Z5 V7 P
- dbType="POPULATED"
; k2 W. z2 N B' X J - fi $ i% x% T" |: i6 `
- ;;
2 A2 k3 r' I. z3 Z6 A/ K" z1 b7 U - "U")
$ u2 `$ I+ e$ G' g8 @5 d - if [ "${updateworldDB}" = "YES" ]; then
9 c. G5 e1 C0 Y! \3 ^' U - updateworldDB="NO"" ?7 U$ b0 D. q. N
- else
' ~3 D* V. _7 j4 g5 A2 h - updateworldDB="YES"
, i" w" f" e9 A# n# T- \ - fi' s: c+ }$ i& Y" @3 X# l- n
- ;;
- d P9 @9 ?" E6 m4 x% c - "T")
8 ^4 _. K9 } G- e, T) ]5 E - if [ "${createrealmDB}" = "YES" ]; then
/ F6 t- @5 N! D - createrealmDB="NO"
& C; H0 d. ` F( l6 E4 n, n - else
; O- z# Y% z; Y/ H+ P' k% U - createrealmDB="YES"7 M5 e" S p* u ~7 Q2 v
- fi ! G y* }/ P4 [0 e* E. Q7 W" g* w
- ;;: e. A1 F. j7 e/ X
- "R")6 q' G' M$ ?7 [: y/ A+ y- n% f+ N! o3 X8 j
- if [ "${loadrealmDB}" = "YES" ]; then
/ W" e4 ^" p" A. z( `; Y, m - loadrealmDB="NO"
6 c+ A. G# v3 _! H7 o$ j* w k7 k8 m) H - else , L% f5 _! s8 H
- loadrealmDB="YES"- N% Z) Z# Y6 y! V5 [7 U
- fi6 J' i6 [! ]' c) @
- ;;
' h6 |4 C! H- k+ g# ` - "Y")
" [. G% U- ~0 N! c, u" l- ~2 ^ - if [ "${updaterealmDB}" = "YES" ]; then$ v/ e/ u) w& M$ r, g
- updaterealmDB="NO"/ t+ F. V3 @! J( n: ]
- else $ M w- i7 v; F) M2 \" h8 q
- updaterealmDB="YES"! i- k$ N) \, i( m; a6 Y% j* X
- fi
6 C u- {6 v( `& ] - ;;
6 x5 _1 s" e$ b- h4 U* T$ @2 d7 B2 ^ - "L")
" R) b: g$ o M - if [ "${addRealmList}" = "YES" ]; then; B$ y! ^# M* v
- addRealmList="NO"" |5 R% ]" Y$ V/ F" O) Z
- else
; x E$ H1 W* X$ M0 O: ^ - addRealmList="YES"& U3 s- c/ H6 `8 m% R* [
- fi
. v' P4 S$ G Q+ M - ;;
3 M/ M( n( S8 n' y$ W: ` - "X")
/ _6 |* g# B# [ - exit 0;;+ ?' W$ R7 T- Y. U, I9 j
- *)" s# l8 p/ x m5 _8 [
- printf "Invalid selection";;; o+ ?, ?" `8 ?$ n- R
- esac* A5 c' z7 M/ Q* M8 |8 Q
- done
! e6 |/ N e$ C; f/ O% ?
' w b, @+ m& D% F/ c! {- printBanner3 l% t; M) V! \ a' E" P
- determineDBName
1 X; P2 D" I# C7 \5 ~ - printf "What is your ${dbname} host name ?\t[${svr_def}]: "
9 F( t, X! b( I - read svr
/ W; E( _' ^/ a5 L; x& H - svr=${svr:-${svr_def}}+ Y X) M6 {: k: M; l" m H; Z$ u
- printf "What is your ${dbname} user name ?\t[${user_def}]: "
7 s2 \5 s' i# M! I/ c7 [7 V+ @$ d - read user. G5 r' M, h. Y
- user=${user:-${user_def}}
6 H" H7 J! v. s& U. z - printf "What is your ${dbname} port ?\t[${port_def}]: "6 O- f- P" j& ?( k1 e
- read port6 K( c2 \! p( a0 S7 I
- port=${port:-${port_def}}
: [3 |( x: x0 [+ B. y! K - if [ $dbname = "MariaDB" ]; then$ z2 Y( w' z! X& j s* e( `: X
- printf "What is your ${dbname} password ?\t []: "
" c* F9 R4 s+ W* g! s - read pass) X2 K8 V4 F4 k9 B! P
- pass=${pass:-${pass_def}}
4 w/ `! P& m6 J8 ?9 m* }" X: N+ A - elif [ $dbname = "MySQL" ]; then
' Y9 v4 w+ q' V! A - mysqlconfigeditor+ w! G5 Y2 F& M! L1 t. f
- $dbconfig& u2 T. X( W. `
- fi% X8 ]' C# a. T+ e" m, u/ w
- determineDBCommand4 {1 O/ [( s# [; P% p, D/ V
: T2 ~6 M1 B" n- if [ "${DUMP}" = "YES" ]; then" a1 D& y- Y4 Z1 f' T# d* V
- printf "Enter it again \t[]: "
0 `* e& m$ ^! E+ [- J0 t - read pass1 R( m2 V# v9 C
- fi
1 D/ }7 [, A0 M* _: {3 d' o
: R, r- \9 w' c- if [ "${createcharDB}" = "YES" ] || [ "${loadcharDB}" = "YES" ] || [ "${updatecharDB}" = "YES" ]; then% a2 o2 x! W. Z. l! |3 d
- printf "What is your Character database name ?\t[${cdb_def}]: " S t% {( _8 f% F: m# a
- read cdb t. ]' k s1 o' h5 S4 Z% E- w }; q
- cdb=${cdb:-${cdb_def}}- H8 ~+ x: E: w5 V
- fi
: `2 k( K F1 M. L
4 V; a) ^6 u$ y, f) ]- if [ "${createworldDB}" = "YES" ] || [ "${loadworldDB}" = "YES" ] || [ "${updateworldDB}" = "YES" ]; then
3 J& @% ]/ z' n- k7 I- R - printf "What is your World database name ?\t[${wdb_def}]: "
) t# Z6 ] R5 l$ N; B/ r - read wdb
8 {! @* d/ u* e1 T5 P - wdb=${wdb:-${wdb_def}}# @9 a. G+ t' `6 Q
- fi6 p: H7 t/ i) w- x) w
U; o: X% |7 S! ?! [& @- if [ "${createrealmDB}" = "YES" ] || [ "${loadrealmDB}" = "YES" ] || [ "${updaterealmDB}" = "YES" ] || [ "${addRealmList}" = "YES" ]; then- ^* T3 ^7 d8 H( V$ @
- printf "What is your Realm database name ?\t[${rdb_def}]: "$ R/ W3 e( l8 j* @+ C" e, @" A
- read rdb
5 v& \- i% E: X3 X; e {, v - rdb=${rdb:-${rdb_def}}1 P6 s* P" X% n n
- fi
9 d) m Y" s, R* n3 @* V - $ a- _: }9 W7 D5 G
- if [ "${createcharDB}" = "YES" ]; then
# L; x3 k& C6 j: X, I) N - createCharDB
7 `3 |# p% }9 K3 R- E/ K; o' J% O4 a - fi
) H, i* b3 n2 b& k* h) r5 V4 A* I
& i/ l" b1 z9 n- if [ "${createworldDB}" = "YES" ]; then# `1 T" w; a( Z
- createWorldDB
" ^! ?- o9 H8 }; i3 I - fi
6 D& e! N- c% S - ( v8 m g! F2 F4 t6 \, W
- if [ "${createrealmDB}" = "YES" ]; then% ^9 O( o" W* J2 ~
- createRealmDB
; E4 Q6 W( T9 {) e. ] - fi! C8 i4 u+ l9 @& W# \
- # g0 Y- x0 t& P8 U1 |4 o
- if [ "${updateworldDB}" = "YES" ]; then. P3 s4 I$ W6 x
- updateWorldDB2 v* U/ R0 ?* t' B/ b; n
- fi
1 C! A' Z, a, A+ V" b
8 M5 y! F- Z) N- if [ "${updaterealmDB}" = "YES" ]; then, W/ a# i2 I* N5 a, M
- updateRealmDB5 q# e' y( H6 k' g
- fi
. S! D9 D1 g) u4 o% Z* W - 8 L+ q% t3 L4 g# T. G$ D2 @
- if [ "${addRealmList}" = "YES" ]; then+ d$ B$ t0 x; ^- X) I, [
- addRealmList' k# {; o t# C$ |; f4 j% I
- fi
* ~1 Z6 m7 z. c! q
& f8 F. F, H k s1 Y. s- if [ "${DUMP}" = "YES" ]; then
! [% M& Q. a7 A: p9 f - printf "Dumping database information...\n"" ]9 g: m8 \7 P5 b3 j
- echo "${svr};${port};${user};${pass};${rdb}" > ~/db.conf4 l! ?- W% S% e
- echo "${svr};${port};${user};${pass};${wdb}" >> ~/db.conf7 {' R$ b1 c0 ?! |1 y
- echo "${svr};${port};${user};${pass};${cdb}" >> ~/db.conf5 j. l/ M G6 u
- fi
K& U0 }) A3 o6 x S
! W7 q. E' F! `0 |5 t1 t: q* |" D- printBanner/ u+ `9 j5 g8 _% ~
- printf "Database creation and load complete :-)\n"
8 j s. d% B+ C% p7 f8 P; S - printf "\n"
复制代码 % n: L# X" K! s+ x8 [; k
|
|