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
# Website: http://gameservermanagers.com
# Download default config from GitHub if needed
fn_fetch_config(){
# Get all default config files for this game
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_configs_from_github() {
echo "${servercfgdefault} ${cfgfiles}"
fn_fetch_config_from_github() {
src="${1}"
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 ""
if [ "${gamename}" != "Hurtworld" ]; then
echo "Creating Configs"
echo "================================="
sleep 1
mkdir -pv "${servercfgdir}"
cd "${servercfgdir}"
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}"
fi
echo "Creating Configs"
echo "================================="
sleep 1
# Fetch game config files from GitHub
fn_fetch_config_files
# TODO: Forklift specific logic for each game into gamedata
fn_disabled_config_stuff() {
if [ "${gamename}" == "7 Days To Die" ]; then
fn_defaultconfig
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
@ -328,3 +339,4 @@ elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
elif [ "${gamename}" == "Unreal Tournament 99" ]; then
fn_ut99config
fi
}

8
lgsm-core

@ -8,7 +8,7 @@
# https://github.com/jaredballou/linuxgsm
# Version of script
version="300116"
version="090516"
# Filename of the core script for installation
core_script="lgsm-core"
@ -164,11 +164,11 @@ fn_get_file(){
cmd="$fetchcmd -O"
fi
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"
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
source "${filepath}"
fi

Loading…
Cancel
Save