From 1e1be717d7a05886f30f41529c3d4dc50856ac6c Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 3 Oct 2020 13:10:10 +0200 Subject: [PATCH] 0.6r4 --- lch | 2 +- lib/installers/deb.sh | 2 +- lib/installers/rpm.sh | 39 ++++++++++++++++++++------------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lch b/lch index ae93a2f..b1e61bd 100755 --- a/lch +++ b/lch @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERSION=0.6r3 +VERSION=0.6r4 DEST=$1 shift 1 ORIG=$@ diff --git a/lib/installers/deb.sh b/lib/installers/deb.sh index 447c9e3..a3adba1 100644 --- a/lib/installers/deb.sh +++ b/lib/installers/deb.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Function +# Functions function get_dep(){ apt-get install -y $@ &> /dev/null diff --git a/lib/installers/rpm.sh b/lib/installers/rpm.sh index 343a0ed..78ffc2b 100644 --- a/lib/installers/rpm.sh +++ b/lib/installers/rpm.sh @@ -1,42 +1,43 @@ #!/usr/bin/env bash -# Function +# Functions function get_dep(){ - # Busca la manera de capturar el error. Y mostrar mensaje en rojo. - yum install -y -q $@ 1> /dev/null - if [[ $@ -ne "p7zip-plugins" ]]; then complete_install $@; fi + if [[ $@ -ne "p7zip-plugins" ]]; then + yum install -y -q $@ 1> /dev/null + else + yum install -y -q $@ 1> /dev/null + if [[ $? -ne 0 ]]; then + if [[ $@ == "p7zip" ]]; then failed_install 7z; else failed_install $@; fi + else + if [[ $@ == "p7zip" ]]; then complete_install 7z; else complete_install $@; fi + fi + fi } function install_centos(){ - if [ -n "$(grep "centos" /etc/*-release)" ]; then - yum install -y -q epel-release 1> /dev/null - rpm -U --quiet http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm 1> /dev/null - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 1> /dev/null - yum repolist 1> /dev/null + if [ -n "$(grep "centos" /etc/*-release)" ]; then + yum install -y -q epel-release &> /dev/null + rpm --quiet --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 &> /dev/null + rpm -U --quiet http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm &> /dev/null fi } - - # Run -echo -e "APT system detected" +echo -e "YUM system detected" echo "---------------------" +yum -y -q update &> /dev/null if [ $# -eq 1 ]; then install_centos if $PRIVSOFT; then rarInstall fi - get_dep tar - get_dep bzip2 - get_dep gzip - get_dep zip - get_dep unzip - get_dep p7zip - get_dep p7zip-plugins + for installer in "tar" "bzip2" "gzip" "zip" "unzip" "p7zip" "p7zip-plugins" + do get_dep $installer + done else for i in $@ do