Explorar el Código

Added check_config.sh

This function checks that servercfgfullpath exists and warns if missing
Daniel Gibbs hace 10 años
padre
commit
840c28011d
Se han modificado 3 ficheros con 28 adiciones y 3 borrados
  1. 8 2
      functions/check.sh
  2. 14 0
      functions/check_config.sh
  3. 6 1
      functions/core_functions.sh

+ 8 - 2
functions/check.sh

@@ -2,7 +2,7 @@
 # LGSM fn_check function
 # LGSM fn_check function
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-lgsm_version="271215"
+lgsm_version="060116"
 
 
 # Description: Overall function for managing checks.
 # Description: Overall function for managing checks.
 # Runs checks that will either halt on or fix an issue.
 # Runs checks that will either halt on or fix an issue.
@@ -59,4 +59,10 @@ do
 	if [ "${allowed_command}" == "${function_selfname}" ]; then
 	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_tmux.sh
 		check_tmux.sh
 	fi
 	fi
-done
+done
+
+if [ "${function_selfname}" != "command_install.sh" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
+		check_config.sh
+	fi
+fi

+ 14 - 0
functions/check_config.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+# LGSM check_config.sh function
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+lgsm_version="060116"
+
+# Description: If server config missing warn user.
+
+if [ ! -e "${servercfgfullpath}" ]; then
+	if [ "${gamename}" != "Hurtworld" ]; then
+		fn_printwarnnl "Configuration file missing"
+		echo "${servercfgfullpath}"
+	fi
+fi

+ 6 - 1
functions/core_functions.sh

@@ -2,7 +2,7 @@
 # LGSM core_functions.sh function
 # LGSM core_functions.sh function
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-lgsm_version="030116"
+lgsm_version="060116"
 
 
 # Description: Defines all functions to allow download and execution of functions using fn_runfunction.
 # Description: Defines all functions to allow download and execution of functions using fn_runfunction.
 # This function is called first before any other function. Without this file other functions would not load.
 # This function is called first before any other function. Without this file other functions would not load.
@@ -101,6 +101,11 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction
 }
 }
 
 
+check_config.sh(){
+functionfile="${FUNCNAME}"
+fn_runfunction
+}
+
 check_ip.sh(){
 check_ip.sh(){
 functionfile="${FUNCNAME}"
 functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction