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