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