4
0
Эх сурвалжийг харах

New download manager

core_dl will handle all downloads for LGSM allowing a consistent
download experience
Daniel Gibbs 10 жил өмнө
parent
commit
60a70250d6

+ 29 - 0
functions/core_dl.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+# LGSM core_dl.sh function
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+lgsm_version="050216"
+
+# Description: Deals with all downloads for LGSM.
+
+fn_curl_dl(){
+curl_filename=$1
+curl_filepath=$2
+curl_url=$3
+echo "curl_filename $curl_filename"
+echo "curl_url ${curl_url}"
+echo "curl_filepath ${curl_filepath}"
+
+echo -ne "Downloading ${mm_file_latest}...\c"
+
+curl_dl=$(curl --fail -o "${curl_filepath}" "${curl_url}" )
+exitcode=$?
+if [ $? -ne 0 ]; then
+	fn_printfaileol
+	echo "${curl_dl}"
+	echo -e "${url}\n"
+	exit ${exitcode}
+else
+	fn_printokeol
+fi
+}

+ 8 - 0
functions/core_functions.sh

@@ -32,6 +32,11 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
+core_dl.sh(){
+functionfile="${FUNCNAME}"
+fn_runfunction	
+}
+
 
 # Command
 
@@ -400,3 +405,6 @@ fn_runfunction
 
 # Calls on-screen messages
 core_messages.sh
+
+#Calls file downloader
+core_dl.sh