Browse Source

Added legacy function to handle legacy scripts

Daniel Gibbs 9 years ago
parent
commit
115a8d6127
2 changed files with 31 additions and 6 deletions
  1. 22 6
      lgsm/functions/core_functions.sh
  2. 9 0
      lgsm/functions/core_legacy.sh

+ 22 - 6
lgsm/functions/core_functions.sh

@@ -9,13 +9,31 @@
 
 core_dl.sh(){
 functionfile="${FUNCNAME}"
-if [ -z $(type fn_bootstrap_fetch_file_github) ];then
+if [ "$(type fn_fetch_core_dl)" ];then
 	fn_fetch_core_dl "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
 else
 	fn_bootstrap_fetch_file_github "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
 fi
 }
 
+core_messages.sh(){
+functionfile="${FUNCNAME}"
+if [ "$(type fn_fetch_core_dl)" ];then
+	fn_fetch_core_dl "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
+else
+	fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
+fi
+}
+
+core_legacy.sh(){
+functionfile="${FUNCNAME}"
+if [ "$(type fn_fetch_core_dl)" ];then
+	fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
+else
+	fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
+fi
+}
+
 core_exit.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
@@ -31,11 +49,6 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-core_messages.sh(){
-functionfile="${FUNCNAME}"
-fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
-}
-
 
 # Commands
 
@@ -550,6 +563,9 @@ if [ ! -d "${tmpdir}" ]; then
 	mkdir -p "${tmpdir}"
 fi
 
+# Calls code required for legacy servers
+core_legacy.sh
+
 # Calls on-screen messages (bootstrap)
 core_messages.sh
 

+ 9 - 0
lgsm/functions/core_legacy.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+# LinuxGSM core_legacy.sh function
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+# Description: Code for backwards compatability with older versions of LinuxGSM.
+
+if [ -z ${serverfiles} ]; then
+	serverfiles="${filesdir}"
+fi