command_install_resources_mta.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # LinuxGSM command_install_resources_mta.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Installs the default resources for Multi Theft Auto.
  7. commandname="DEFAULT-RESOURCES"
  8. commandaction="Default Resources"
  9. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  10. fn_firstcommand_set
  11. fn_install_resources() {
  12. echo -e ""
  13. echo -e "${bold}${lightyellow}Installing Default Resources${default}"
  14. fn_messages_separator
  15. fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash"
  16. fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}"
  17. echo -e "Default Resources Installed."
  18. }
  19. fn_print_header
  20. if [ -z "${autoinstall}" ]; then
  21. fn_print_warning_nl "Installing the default resources with existing resources may cause issues."
  22. if fn_prompt_yn "Do you want to install MTA default resources?" Y; then
  23. fn_install_resources
  24. fi
  25. else
  26. fn_print_warning_nl "Default resources are not installed when using ./${selfname} auto-install."
  27. fn_print_information_nl "To install default resources use ./${selfname} install"
  28. fi