Skip to content
Prev Previous commit
Next Next commit
Fixies & cleanup
  • Loading branch information
FliesWithWind committed Mar 15, 2023
commit 8a0fcfed123bdab6bcca8bb58bc7339b4395372a
2 changes: 1 addition & 1 deletion lgsm/config-default/config-lgsm/arma3server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ servermods=""
## Mods to be downloaded from Steam Workshop
# Use workshop ids
# workshopmods="450814997;2131302796"
workshopmods="450814997;2131302796"
workshopmods=""

## Path to BattlEye
# Leave empty for default
Expand Down
149 changes: 29 additions & 120 deletions lgsm/functions/command_workshop_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,124 +14,33 @@ check.sh
workshop_core.sh

fn_print_header

fn_workshop_download "450814997"

# # Displays a list of installed mods.
# fn_mods_installed_list
# if [ "${installedmodscount}" -gt "0" ]; then
# echo -e "Installed addons/mods"
# echo -e "================================="
# # Go through all available commands, get details and display them to the user.
# for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do
# # Current mod is the "llindex" value of the array we're going through.
# currentmod="${installedmodslist[llindex]}"
# fn_mod_get_info
# # Display mod info to the user.
# echo -e " * ${green}${modcommand}${default}${default}"
# done
# echo -e ""
# fi

# echo -e "Available addons/mods"
# echo -e "================================="
# # Display available mods from mods_list.sh.
# # Set and reset vars
# compatiblemodslistindex=0
# # As long as we're within index values.
# while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do
# # Set values for convenience.
# displayedmodname="${compatiblemodslist[compatiblemodslistindex]}"
# displayedmodcommand="${compatiblemodslist[compatiblemodslistindex + 1]}"
# displayedmodsite="${compatiblemodslist[compatiblemodslistindex + 2]}"
# displayedmoddescription="${compatiblemodslist[compatiblemodslistindex + 3]}"
# # Output mods to the user.
# echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}"
# echo -e " * ${cyan}${displayedmodcommand}${default}"
# # Increment index from the amount of values we just displayed.
# let "compatiblemodslistindex+=4"
# ((totalmodsavailable++))
# done

# # If no mods are available for a specific game.
# if [ -z "${compatiblemodslist}" ]; then
# fn_print_fail_nl "No mods are currently available for ${gamename}."
# fn_script_log_info "No mods are currently available for ${gamename}."
# core_exit.sh
# fi
# fn_script_log_info "${totalmodsavailable} addons/mods are available for install"

# ## User selects a mod.
# echo -e ""
# while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; do
# echo -en "Enter an ${cyan}addon/mod${default} to ${green}install${default} (or exit to abort): "
# read -r usermodselect
# # Exit if user says exit or abort.
# if [ "${usermodselect}" == "exit" ] || [ "${usermodselect}" == "abort" ]; then
# core_exit.sh
# # Supplementary output upon invalid user input.
# elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then
# fn_print_error2_nl "${usermodselect} is not a valid addon/mod."
# fi
# done
# # Get mod info.
# currentmod="${usermodselect}"
# fn_mod_get_info

# echo -e ""
# echo -e "Installing ${modprettyname}"
# echo -e "================================="
# fn_script_log_info "${modprettyname} selected for install"

# # Check if the mod is already installed and warn the user.
# if [ -f "${modsinstalledlistfullpath}" ]; then
# if [ "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then
# fn_print_warning_nl "${modprettyname} is already installed"
# fn_script_log_warn "${modprettyname} is already installed"
# echo -e " * Any configs may be overwritten."
# if ! fn_prompt_yn "Continue?" Y; then
# core_exit.sh
# fi
# fn_script_log_info "User selected to continue"
# fi
# fi

# ## Installation.
# # If amxmodx check if metamod exists first
# if [ "${modcommand}" == "amxmodx" ]; then
# fn_mod_exist "metamod"
# fi

# if [ "${modcommand}" == "amxmodxcs" ] \
# || [ "${modcommand}" == "amxmodxdod" ] \
# || [ "${modcommand}" == "amxmodxtfc" ] \
# || [ "${modcommand}" == "amxmodxns" ] \
# || [ "${modcommand}" == "amxmodxts" ]; then
# fn_mod_exist "amxmodx"
# fi

# fn_create_mods_dir
# fn_mods_clear_tmp_dir
# fn_mods_create_tmp_dir
# fn_mod_install_files
# fn_mod_lowercase
# fn_mod_create_filelist
# fn_mod_copy_destination
# fn_mod_add_list
# fn_mod_tidy_files_list
# fn_mods_clear_tmp_dir

# # Create/modify existing liblist.gam file for Metamod
# if [ "${modcommand}" == "metamod" ]; then
# fn_mod_install_liblist_gam_file
# fi

# # Create/modify plugins.ini file for Metamod
# if [ "${modcommand}" == "amxmodx" ]; then
# fn_mod_install_amxmodx_file
# fi

# echo -e "${modprettyname} installed"
# fn_script_log_pass "${modprettyname} installed."

fn_create_workshop_dir
fn_workshop_get_list

# Displays a list of installed mods.

echo -e ""
echo -e "Installed workshop addons/mods"
echo -e "================================="
fn_workshop_installed_list

for modid in "${workshoplist[@]}"; do
# Check if the mod is already installed and warn the user.
# if ! fn_workshop_check_mod_update $modid; then
# fn_print_warning_nl "$(fn_workshop_get_mod_name ${modid}) is already installed"
# fn_script_log_warn "$(fn_workshop_get_mod_name ${modid}) is already installed"
# echo -e " * Any configs may be overwritten."
# if ! fn_prompt_yn "Continue?" Y; then
# core_exit.sh
# fi
# fn_script_log_info "User selected to continue"
# fi
echo -e ""
echo -e "Installing $(fn_workshop_get_mod_name ${modid})."
echo -e "================================="
fn_workshop_download $modid
fn_workshop_copy_destination $modid
done

fn_workshop_lowercase
core_exit.sh
135 changes: 11 additions & 124 deletions lgsm/functions/command_workshop_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,138 +12,25 @@ fn_firstcommand_set

check.sh
workshop_core.sh

fn_print_header

fn_create_workshop_dir
fn_workshop_get_list

# Displays a list of installed mods.
echo -e "Installed workshop addons/mods"
echo -e "================================="
fn_workshop_installed_list

for modid in "${workshoplist[@]}"; do
modname="$(fn_workshop_get_mod_name $modid)"
if fn_workshop_check_mod_update $modid; then
echo "Mod ${modname} is not up to date."
echo "Mod ${modname} (${modid}) is not up to date."
fn_workshop_download $modid
else
fn_workshop_copy_destination $modid
else
echo "Mod $modname is up to date."
fi
fi
done

#fn_workshop_download "450814997"

# # Displays a list of installed mods.
# fn_mods_installed_list
# if [ "${installedmodscount}" -gt "0" ]; then
# echo -e "Installed addons/mods"
# echo -e "================================="
# # Go through all available commands, get details and display them to the user.
# for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do
# # Current mod is the "llindex" value of the array we're going through.
# currentmod="${installedmodslist[llindex]}"
# fn_mod_get_info
# # Display mod info to the user.
# echo -e " * ${green}${modcommand}${default}${default}"
# done
# echo -e ""
# fi

# echo -e "Available addons/mods"
# echo -e "================================="
# # Display available mods from mods_list.sh.
# # Set and reset vars
# compatiblemodslistindex=0
# # As long as we're within index values.
# while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do
# # Set values for convenience.
# displayedmodname="${compatiblemodslist[compatiblemodslistindex]}"
# displayedmodcommand="${compatiblemodslist[compatiblemodslistindex + 1]}"
# displayedmodsite="${compatiblemodslist[compatiblemodslistindex + 2]}"
# displayedmoddescription="${compatiblemodslist[compatiblemodslistindex + 3]}"
# # Output mods to the user.
# echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}"
# echo -e " * ${cyan}${displayedmodcommand}${default}"
# # Increment index from the amount of values we just displayed.
# let "compatiblemodslistindex+=4"
# ((totalmodsavailable++))
# done

# # If no mods are available for a specific game.
# if [ -z "${compatiblemodslist}" ]; then
# fn_print_fail_nl "No mods are currently available for ${gamename}."
# fn_script_log_info "No mods are currently available for ${gamename}."
# core_exit.sh
# fi
# fn_script_log_info "${totalmodsavailable} addons/mods are available for install"

# ## User selects a mod.
# echo -e ""
# while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; do
# echo -en "Enter an ${cyan}addon/mod${default} to ${green}install${default} (or exit to abort): "
# read -r usermodselect
# # Exit if user says exit or abort.
# if [ "${usermodselect}" == "exit" ] || [ "${usermodselect}" == "abort" ]; then
# core_exit.sh
# # Supplementary output upon invalid user input.
# elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then
# fn_print_error2_nl "${usermodselect} is not a valid addon/mod."
# fi
# done
# # Get mod info.
# currentmod="${usermodselect}"
# fn_mod_get_info

# echo -e ""
# echo -e "Installing ${modprettyname}"
# echo -e "================================="
# fn_script_log_info "${modprettyname} selected for install"

# # Check if the mod is already installed and warn the user.
# if [ -f "${modsinstalledlistfullpath}" ]; then
# if [ "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then
# fn_print_warning_nl "${modprettyname} is already installed"
# fn_script_log_warn "${modprettyname} is already installed"
# echo -e " * Any configs may be overwritten."
# if ! fn_prompt_yn "Continue?" Y; then
# core_exit.sh
# fi
# fn_script_log_info "User selected to continue"
# fi
# fi

# ## Installation.
# # If amxmodx check if metamod exists first
# if [ "${modcommand}" == "amxmodx" ]; then
# fn_mod_exist "metamod"
# fi

# if [ "${modcommand}" == "amxmodxcs" ] \
# || [ "${modcommand}" == "amxmodxdod" ] \
# || [ "${modcommand}" == "amxmodxtfc" ] \
# || [ "${modcommand}" == "amxmodxns" ] \
# || [ "${modcommand}" == "amxmodxts" ]; then
# fn_mod_exist "amxmodx"
# fi

# fn_create_mods_dir
# fn_mods_clear_tmp_dir
# fn_mods_create_tmp_dir
# fn_mod_install_files
# fn_mod_lowercase
# fn_mod_create_filelist
# fn_mod_copy_destination
# fn_mod_add_list
# fn_mod_tidy_files_list
# fn_mods_clear_tmp_dir

# # Create/modify existing liblist.gam file for Metamod
# if [ "${modcommand}" == "metamod" ]; then
# fn_mod_install_liblist_gam_file
# fi

# # Create/modify plugins.ini file for Metamod
# if [ "${modcommand}" == "amxmodx" ]; then
# fn_mod_install_amxmodx_file
# fi

# echo -e "${modprettyname} installed"
# fn_script_log_pass "${modprettyname} installed."

fn_workshop_lowercase
core_exit.sh
Loading