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