Bläddra i källkod

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 år sedan
förälder
incheckning
49f0efadc8
2 ändrade filer med 24 tillägg och 5 borttagningar
  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)
 		forceupdate=1;
 		fn_update_check;;
+	update-functions)
+		fn_update_funtions;;
 	validate)
 		fn_validate;;
 	monitor)
@@ -41,7 +43,7 @@ case "$getopt" in
 	auto-install)
 		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;;
 esac
 exit
@@ -57,6 +59,8 @@ case "$getopt" in
 		fn_restart;;
 	update)
 		fn_update_check;;
+	update-functions)
+		fn_update_funtions;;
 	monitor)
 		fn_monitor;;
 	email-test)
@@ -66,7 +70,7 @@ case "$getopt" in
 	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;;
 esac
 exit
@@ -80,6 +84,8 @@ case "$getopt" in
 		fn_stop;;
 	restart)
 		fn_restart;;
+	update-functions)
+		fn_update_funtions;;
 	monitor)
 		fn_monitor;;
 	email-test)
@@ -97,7 +103,7 @@ case "$getopt" in
 	map-compressor)
 		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;;
 esac
 exit
@@ -120,6 +126,8 @@ case "$getopt" in
 	update-restart)
 		forceupdate=1;
 		fn_update_check;;
+	update-functions)
+		fn_update_funtions;;
 	validate)
 		fn_validate;;
 	monitor)
@@ -141,7 +149,7 @@ case "$getopt" in
 	map-compressor)
 		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;;
 esac
 exit
@@ -156,6 +164,8 @@ case "$getopt" in
 		fn_stop;;
 	restart)
 		fn_restart;;
+	update-functions)
+		fn_update_funtions;;
 	monitor)
 		fn_monitor;;
 	email-test)
@@ -173,7 +183,7 @@ case "$getopt" in
 	map-compressor)
 		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;;
 esac
 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/"*