Răsfoiți Sursa

Added update functions option

This new option will update the functions to the newest version by
simply deleting the contents of the functions dir
Daniel Gibbs 11 ani în urmă
părinte
comite
49f0efadc8
2 a modificat fișierele cu 24 adăugiri și 5 ștergeri
  1. 15 5
      functions/fn_getopt
  2. 9 0
      functions/fn_update_funtions

+ 15 - 5
functions/fn_getopt

@@ -22,6 +22,8 @@ case "$getopt" in
 	update-restart)
 	update-restart)
 		forceupdate=1;
 		forceupdate=1;
 		fn_update_check;;
 		fn_update_check;;
+	update-functions)
+		fn_update_funtions;;
 	validate)
 	validate)
 		fn_validate;;
 		fn_validate;;
 	monitor)
 	monitor)
@@ -41,7 +43,7 @@ case "$getopt" in
 	auto-install)
 	auto-install)
 		fn_autoinstall;;
 		fn_autoinstall;;
 	*)
 	*)
-	echo "Usage: $0 {start|stop|restart|update|force-update|validate|monitor|email-test|details|backup|console|debug|install|auto-install}"
+	echo "Usage: $0 {start|stop|restart|update|force-update|update-funtions|validate|monitor|email-test|details|backup|console|debug|install|auto-install}"
 	exit 1;;
 	exit 1;;
 esac
 esac
 exit
 exit
@@ -57,6 +59,8 @@ case "$getopt" in
 		fn_restart;;
 		fn_restart;;
 	update)
 	update)
 		fn_update_check;;
 		fn_update_check;;
+	update-functions)
+		fn_update_funtions;;
 	monitor)
 	monitor)
 		fn_monitor;;
 		fn_monitor;;
 	email-test)
 	email-test)
@@ -66,7 +70,7 @@ case "$getopt" in
 	backup)
 	backup)
 		fn_backup;;
 		fn_backup;;
 	*)
 	*)
-		echo "Usage: $0 {start|stop|restart|update|monitor|email-test|details|backup}"
+		echo "Usage: $0 {start|stop|restart|update|update-funtions|monitor|email-test|details|backup}"
 		exit 1;;
 		exit 1;;
 esac
 esac
 exit
 exit
@@ -80,6 +84,8 @@ case "$getopt" in
 		fn_stop;;
 		fn_stop;;
 	restart)
 	restart)
 		fn_restart;;
 		fn_restart;;
+	update-functions)
+		fn_update_funtions;;
 	monitor)
 	monitor)
 		fn_monitor;;
 		fn_monitor;;
 	email-test)
 	email-test)
@@ -97,7 +103,7 @@ case "$getopt" in
 	map-compressor)
 	map-compressor)
 		fn_compress_ut99maps;;
 		fn_compress_ut99maps;;
 	*)
 	*)
-	echo "Usage: $0 {start|stop|restart|monitor|email-test|details|backup|console|debug|install|map-compressor}"
+	echo "Usage: $0 {start|stop|restart|update-funtions|monitor|email-test|details|backup|console|debug|install|map-compressor}"
 	exit 1;;
 	exit 1;;
 esac
 esac
 exit
 exit
@@ -120,6 +126,8 @@ case "$getopt" in
 	update-restart)
 	update-restart)
 		forceupdate=1;
 		forceupdate=1;
 		fn_update_check;;
 		fn_update_check;;
+	update-functions)
+		fn_update_funtions;;
 	validate)
 	validate)
 		fn_validate;;
 		fn_validate;;
 	monitor)
 	monitor)
@@ -141,7 +149,7 @@ case "$getopt" in
 	map-compressor)
 	map-compressor)
 		fn_compress_unreal2maps;;
 		fn_compress_unreal2maps;;
 	*)
 	*)
-	echo "Usage: $0 {start|stop|restart|update|validate|monitor|email-test|details|backup|console|debug|install|auto-install|map-compressor}"
+	echo "Usage: $0 {start|stop|restart|update|update-funtions|validate|monitor|email-test|details|backup|console|debug|install|auto-install|map-compressor}"
 	exit 1;;
 	exit 1;;
 esac
 esac
 exit
 exit
@@ -156,6 +164,8 @@ case "$getopt" in
 		fn_stop;;
 		fn_stop;;
 	restart)
 	restart)
 		fn_restart;;
 		fn_restart;;
+	update-functions)
+		fn_update_funtions;;
 	monitor)
 	monitor)
 		fn_monitor;;
 		fn_monitor;;
 	email-test)
 	email-test)
@@ -173,7 +183,7 @@ case "$getopt" in
 	map-compressor)
 	map-compressor)
 		fn_compress_unreal2maps;;
 		fn_compress_unreal2maps;;
 	*)
 	*)
-	echo "Usage: $0 {start|stop|restart|monitor|email-test|details|backup|console|debug|install|map-compressor}"
+	echo "Usage: $0 {start|stop|restart|update-funtions|monitor|email-test|details|backup|console|debug|install|map-compressor}"
 	exit 1;;
 	exit 1;;
 esac
 esac
 exit
 exit

+ 9 - 0
functions/fn_update_funtions

@@ -0,0 +1,9 @@
+#!/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/"*