Linux Compressor Humanizer https://lch.hatthieves.es
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #!/usr/bin/env bash
  2. function rarInstall(){
  3. if [ -e "$(command -v wget)" ] || [ -e "$(command -v curl)" ]
  4. then
  5. if [[ "$(uname -m)" == "x86_64" ]]
  6. then
  7. RAR_URL="https://www.rarlab.com/rar/rarlinux-x64-5.9.1.tar.gz"
  8. RAR_FILE="rarlinux-x64-5.9.1.tar.gz"
  9. else
  10. RAR_URL="https://www.rarlab.com/rar/rarlinux-5.9.1.tar.gz"
  11. RAR_FILE="rarlinux-5.9.1.tar.gz"
  12. fi
  13. if [ -e "$(command -v wget)" ]
  14. then
  15. wget -q $RAR_URL > /dev/null
  16. else
  17. curl -s -o $RAR_FILE $RAR_URL > /dev/null
  18. fi
  19. tar -zxvf $RAR_FILE > /dev/null
  20. cd rar
  21. cp -v rar unrar /usr/local/bin/ > /dev/null
  22. cd ..
  23. rm -r rar $RAR_FILE > /dev/null
  24. complete_install "rar"
  25. else
  26. echo -e "\n$RED[Error]$RESET - wget or curl are not in the system, so rar could not be installed.\nPlease, install wget or curl.\n"
  27. read -p "Press [ENTER] to continue installing or [CTRL+C] to exit."
  28. fi
  29. }
  30. function install()
  31. {
  32. if [ "$UID" != "0" ]; then
  33. echo " Only root can execute this script, sorry."
  34. echo " Try 'sudo lch $@'"
  35. exit 0
  36. fi
  37. if [ $# -eq 1 ]; then
  38. # Poner aviso "Vamos a instalarlo todo y mucho"
  39. read -p "Do you want to install non-free software? (rar, unrar) [y/N]: " PRIVSOFT
  40. case ${PRIVSOFT} in
  41. y | Y | yes)
  42. PRIVSOFT=true
  43. echo -e "\nInstall all dependencies (with non-free)\n";;
  44. *)
  45. PRIVSOFT=false
  46. echo -e "\nOnly will install free software.\n";;
  47. esac
  48. else
  49. PRIVSOFT=false
  50. fi
  51. if [ -x "$(command -v apt)" ]
  52. then
  53. if [[ -e ./lib/installers/deb.sh ]]; then . ./lib/installers/deb.sh; else . /usr/lib/lch/installers/deb.sh; fi
  54. elif [ -x "$(command -v yum)" ]
  55. then
  56. if [[ -e ./lib/installers/rpm.sh ]]; then . ./lib/installers/rpm.sh; else . /usr/lib/lch/installers/rpm.sh; fi
  57. elif [ -x "$(command -v pacman)" ]
  58. then
  59. if [[ -e ./lib/installers/pacman.sh ]]; then . ./lib/installers/pacman.sh; else . /usr/lib/lch/installers/pacman.sh; fi
  60. elif [ -x "$(command -v zypper)" ]
  61. then
  62. if [[ -e ./lib/installers/zypper.sh ]]; then . ./lib/installers/zypper.sh; else . /usr/lib/lch/installers/zypper.sh; fi
  63. else
  64. echo -e "System installer not detected"
  65. fi
  66. echo -e "\nDependencies installation finished\n"
  67. }