From 8ca7bca3cacd29a5449c1a04f025dd290d17e89c Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 15 Jan 2017 03:25:51 +0100 Subject: [PATCH] Testing for multiple installations --- lgsm/functions/command_mods_update.sh | 44 +++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index f162bb33b..272fee642 100644 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -27,12 +27,44 @@ fn_mods_update_init(){ echo -e " * \e[36m$(sed "${installedmodsline}q;d" "${modslockfilefullpath}")\e[0m" let installedmodsline=installedmodsline+1 done - exit - #currentmod="${usermodselect}" - #fn_mod_get_info_from_command - #fn_print_dots_nl "Updating ${modprettyname}" - #sleep 1 - #fn_script_log "Updating ${modprettyname}." + sleep 2 +} + +fn_mods_update_loop(){ + while [ $installedmodsline -le $installedmodscount ]; do + currentmod="$(sed "${installedmodsline}q;d" "${modslockfilefullpath}")" + fn_mod_get_info_from_command + if [ -n "${currentmod}" ]; then + fn_print_dots_nl "Updating ${modprettyname}" + sleep 0.5 + fn_script_log "Updating ${modprettyname}." + # Get mod info + fn_mod_get_info_from_command + # Check if mod is already installed + fn_mod_already_installed + # Check and create required directories + fn_mods_dir + # Clear lgsm/tmp/mods dir if exists then recreate it + fn_clear_tmp_mods + fn_mods_tmpdir + # Download mod + fn_mod_dl + # Extract the mod + fn_mod_extract + # Build a file list + fn_mod_fileslist + # Copying to destination + fn_mod_copy_destination + # Ending with installation routines + fn_mod_add_list + fn_clear_tmp_mods + fn_print_ok_nl "${modprettyname} installed." + fn_script_log "${modprettyname} installed." + else + fn_print_fail "No mod was selected." + core_exit.sh + fi + done } fn_mods_update_init