4
0
Daniel Gibbs 9 жил өмнө
parent
commit
d34833efce

+ 10 - 3
lgsm/functions/command_update_linuxgsm.sh

@@ -26,7 +26,7 @@ else
 	fn_print_ok_eol_nl
 fi
 
-echo -ne "    checking remote linuxgsm.sh...\c"
+echo -ne "    checking linuxgsm.sh...\c"
 tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
 if [ "${tmp_script_diff}" != "" ]; then
 	fn_print_update_eol_nl
@@ -40,6 +40,7 @@ fi
 echo -ne "    checking ${selfname}...\c"
 script_diff=$(diff <(sed '/shortname/d;/servername/d;/gamename/d' "${tmpdir}/linuxgsm.sh") <(sed '/shortname/d;/servername/d;/gamename/d' "${rootdir}/${selfname}"))
 if [ "${script_diff}" != "" ]; then
+	fn_print_update_eol_nl
 	echo -ne "    backup ${selfname}...\c"
 	cp "${rootdir}/${selfname}" "${tmpdir}/${selfname}-$(date +"%m_%d_%Y_%M").bak"
 	if [ $? -ne 0 ]; then
@@ -47,13 +48,19 @@ if [ "${script_diff}" != "" ]; then
 		core_exit.sh
 	else
 		fn_print_ok_eol_nl
-		echo -en "${tmpdir}/${selfname}-$(date +"%m_%d_%Y_%M").bak"
+		echo -e "	Backup: ${tmpdir}/${selfname}-$(date +"%m_%d_%Y_%M").bak"
 	fi
-
+	echo -ne "    fetch ${selfname}...\c"
 	cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
 	sed -i "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${rootdir}/${selfname}"
 	sed -i "s/servername=\"core\"/servername=\"${servername}\"/g" "${rootdir}/${selfname}"
 	sed -i "s/gamename=\"core\"/gamename=\"${gamename}\"/g" "${rootdir}/${selfname}"
+	if [ $? -ne 0 ]; then
+		fn_print_fail_eol_nl
+		core_exit.sh
+	else
+		fn_print_ok_eol_nl
+	fi
 else
 	fn_print_ok_eol_nl
 fi