Explorar o código

Added error checking. Corrected typo

Daniel Gibbs %!s(int64=11) %!d(string=hai) anos
pai
achega
624af378cc
Modificáronse 3 ficheiros con 21 adicións e 10 borrados
  1. 1 1
      functions/fn_functions
  2. 20 0
      functions/fn_update_functions
  3. 0 9
      functions/fn_update_funtions

+ 1 - 1
functions/fn_functions

@@ -164,7 +164,7 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction
 }
 }
 
 
-fn_update_funtions(){
+fn_update_functions(){
 functionfile="${FUNCNAME}"
 functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction
 }
 }

+ 20 - 0
functions/fn_update_functions

@@ -0,0 +1,20 @@
+#!/bin/bash
+# LGSM fn_update_functions function
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+# Version: 190515
+
+# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
+
+fn_printdots "Updating functions"
+fn_scriptlog "Updating functions"
+sleep 1
+rm -rfv "${rootdir}/functions/"*
+exitcode=$?
+if [ "${exitcode}" == "0" ]; then
+	fn_printok "Updating functions"
+	fn_scriptlog "Successfull! Updating functions"
+else
+	fn_printokfail "Updating functions"
+	fn_scriptlog "Failure! Updating functions"
+fi

+ 0 - 9
functions/fn_update_funtions

@@ -1,9 +0,0 @@
-#!/bin/bash
-# LGSM fn_update_funtions function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-# Version: 190515
-
-# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
-
-rm -rfv "${rootdir}/functions/"*