From c394876fcb9177851176ceea11b3279df88b5fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Adolfo=20Mesa=20Rold=C3=A1n?= Date: Sat, 3 Oct 2020 11:42:11 +0200 Subject: [PATCH] 0.6r0 --- lib/installer.sh | 12 +++++------ lib/installers/apt.sh | 46 +++++++++++++++++++++++++++---------------- lib/resources.sh | 4 ++++ 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/lib/installer.sh b/lib/installer.sh index 7db8e7d..27409aa 100644 --- a/lib/installer.sh +++ b/lib/installer.sh @@ -11,13 +11,13 @@ function rarInstall(){ RAR_URL="https://www.rarlab.com/rar/rarlinux-5.9.1.tar.gz" RAR_FILE="rarlinux-5.9.1.tar.gz" fi - wget $RAR_URL - tar -zxvf $RAR_FILE + wget -q $RAR_URL > /dev/null + tar -zxvf $RAR_FILE > /dev/null cd rar - cp -v rar unrar /usr/local/bin/ + cp -v rar unrar /usr/local/bin/ > /dev/null cd .. - rm -r rar $RAR_FILE - echo "rar/unrar installed." + rm -r rar $RAR_FILE > /dev/null + complete_install "rar" else echo -e "\n\e[91m[Error]\e[0m - wget is not installed, so rar could not be installed.\nPlease install wget.\n" read -p "Press [ENTER] to continue installing or [CTRL+C] to exit." @@ -79,5 +79,5 @@ function install() echo -e "System installer not detected" fi - echo -e "Dependencies installation finished\n" + echo -e "\nDependencies installation finished\n" } \ No newline at end of file diff --git a/lib/installers/apt.sh b/lib/installers/apt.sh index 6bdacbe..83be413 100644 --- a/lib/installers/apt.sh +++ b/lib/installers/apt.sh @@ -2,34 +2,46 @@ # Function -function install(){ - echo "$@:" +function get_dep(){ # Busca la manera de capturar el error. Y mostrar mensaje en rojo. apt-get install -y $@ 1> /dev/null - echo "e[32mInstalled\e[0m" + complete_install $@ } # Run echo -e "APT system detected" -echo $@ -echo $1 -echo $0 -echo $PRIVSOFT -echo "----------" +echo "---------------------" -install $2 if [ $# -eq 1 ]; then - install tar - install bzip2 - install gzip - install zip - install unzip - install p7zip-full p7zip-rar + if $PRIVSOFT; then + rarInstall + fi + get_dep tar + get_dep bzip2 + get_dep gzip + get_dep zip + get_dep unzip + get_dep p7zip-full else - #Tropa - + for i in $@ + do + if [ $i != "-i" ] + then + case $i in + "rar" | "unrar") + rarInstall + ;; + "7z" | "7zip" | "p7zip") + get_dep p7zip-full + ;; + *) + get_dep $i + ;; + esac + fi + done fi # apt-get install -y tar bzip2 gzip zip unzip p7zip-full p7zip-rar 1> /dev/null \ No newline at end of file diff --git a/lib/resources.sh b/lib/resources.sh index ee8790d..2a27df8 100644 --- a/lib/resources.sh +++ b/lib/resources.sh @@ -70,4 +70,8 @@ function executer() else error_not_install $1 fi +} + +complete_install(){ + echo -e "$@:\t\t\t\e[32mComplete\e[0m" } \ No newline at end of file