From ea018494b0758d94bcbc51bdba6c6d17fa3f154a Mon Sep 17 00:00:00 2001 From: Braunson Date: Fri, 20 Jan 2017 11:55:08 -0600 Subject: [PATCH] fix_mta for libmysql --- lgsm/functions/core_functions.sh | 10 +++++----- lgsm/functions/fix.sh | 2 ++ lgsm/functions/fix_mta.sh | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 lgsm/functions/fix_mta.sh diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 8c92f3198..df8b4980c 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -374,6 +374,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +fix_mta.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + # Info info_config.sh(){ @@ -576,11 +581,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } -install_mta_resources.sh(){ -functionfile="${FUNCNAME}" -fn_fetch_function -} - # Calls the global Ctrl-C trap core_trap.sh diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 85a65a814..327fcccf9 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -47,6 +47,8 @@ if [ "${function_selfname}" != "command_install.sh" ]; then fix_ins.sh elif [ "${gamename}" == "Rust" ]; then fix_rust.sh + elif [ "${gamename}" == "Multi Theft Auto" ]; then + fix_mta.sh fi fi diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh new file mode 100644 index 000000000..72d3228bd --- /dev/null +++ b/lgsm/functions/fix_mta.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LGSM fix_mta.sh function +# Author: Daniel Gibbs +# Contributor: ChaosMTA +# Website: https://gameservermanagers.com +# Description: Installs the libmysqlclient for database functions on the server +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" + +if [ ! -f /usr/lib/libmysqlclient.so.16 ]; then + fixname="libmysqlclient16 install" + fn_fix_msg_start + fn_print_warn_nl "libmysqlclient16 not installed. Installing.." + sleep 1 + fileurl="https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16"; filedir="${lgsmdir}/lib"; filename="libmysqlclient.so.16"; executecmd="executecmd" run="norun"; force="noforce"; md5="6c188e0f8fb5d7a29f4bc413b9fed6c2" + fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" + fn_fix_msg_end +fi +} + +fixname="libmysqlclient16" +fn_fix_msg_start +export LD_LIBRARY_PATH=:"${libdir}" +fn_fix_msg_end