Browse Source

Install now pulls config files down and places them in the servercfgdir as part of install. Need to break this out as a separate action, so that new instances that get created have their configs pulled and parsed if missing.

pull/553/head
Jared Ballou 10 years ago
parent
commit
f5351ed345
  1. 40
      functions/install_config.sh
  2. 8
      lgsm-core

40
functions/install_config.sh

@ -3,15 +3,24 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://gameservermanagers.com # Website: http://gameservermanagers.com
# Download default config from GitHub if needed # Get all default config files for this game
fn_fetch_config(){ fn_fetch_config_files() {
for cfg in $servercfgdefault $cfgfiles; do
src="$(echo "${cfg}" | cut -d':' -f1)"
dst="$(echo "${cfg}" | cut -d':' -f2-)"
fn_fetch_config_from_github "${src}" "${dst}"
done
} }
# Get all default config files for this game fn_fetch_config_from_github() {
fn_fetch_configs_from_github() { src="${1}"
echo "${servercfgdefault} ${cfgfiles}" dst="${2}"
if [ "${dst}" == "" ]; then
dst="${src}"
fi
dst="$(echo "${dst}" | sed -e "s/lgsm-default/${servicename}/g")"
fn_getgithubfile "${servercfgdir}/${dst}" norun "gamedata/games/${selfname}/cfg/${src}"
} }
fn_fetch_configs_from_github
@ -151,15 +160,17 @@ fn_unreal2config(){
} }
echo "" echo ""
if [ "${gamename}" != "Hurtworld" ]; then echo "Creating Configs"
echo "Creating Configs" echo "================================="
echo "=================================" sleep 1
sleep 1
mkdir -pv "${servercfgdir}" # Fetch game config files from GitHub
cd "${servercfgdir}" fn_fetch_config_files
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}"
fi
# TODO: Forklift specific logic for each game into gamedata
fn_disabled_config_stuff() {
if [ "${gamename}" == "7 Days To Die" ]; then if [ "${gamename}" == "7 Days To Die" ]; then
fn_defaultconfig fn_defaultconfig
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
@ -328,3 +339,4 @@ elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
elif [ "${gamename}" == "Unreal Tournament 99" ]; then elif [ "${gamename}" == "Unreal Tournament 99" ]; then
fn_ut99config fn_ut99config
fi fi
}

8
lgsm-core

@ -8,7 +8,7 @@
# https://github.com/jaredballou/linuxgsm # https://github.com/jaredballou/linuxgsm
# Version of script # Version of script
version="300116" version="090516"
# Filename of the core script for installation # Filename of the core script for installation
core_script="lgsm-core" core_script="lgsm-core"
@ -164,11 +164,11 @@ fn_get_file(){
cmd="$fetchcmd -O" cmd="$fetchcmd -O"
fi fi
fetch=$($cmd "${filepath}" "${fileurl}" 2>&1) fetch=$($cmd "${filepath}" "${fileurl}" 2>&1)
if [ "${exec}" == "run" ] || [ "${exec}" == "exec" ] || [ "${exec}" == "1" ] || [ "${exec}" != "noexec" ] || [ "${exec}" != "norun" ]; then
chmod +x "${filepath}"
fi
fn_colortext 32 "DONE" fn_colortext 32 "DONE"
fi fi
if [ "${exec}" == "run" ] || [ "${exec}" == "exec" ] || [ "${exec}" == "1" ] || [ "${exec}" != "noexec" ] || [ "${exec}" != "norun" ]; then
chmod +x "${filepath}"
fi
if [ "${exec}" == "run" ] || [ "${exec}" == "exec" ] || [ "${exec}" == "1" ]; then if [ "${exec}" == "run" ] || [ "${exec}" == "exec" ] || [ "${exec}" == "1" ]; then
source "${filepath}" source "${filepath}"
fi fi

Loading…
Cancel
Save