diff --git a/functions/install_config.sh b/functions/install_config.sh index 6e937f3a1..d4c268f73 100644 --- a/functions/install_config.sh +++ b/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 +} diff --git a/lgsm-core b/lgsm-core index 12de6d9a2..19b554c96 100755 --- a/lgsm-core +++ b/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