From 909c8186cab982dee2da39e38f1550a88c45b5d2 Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 3 Oct 2020 13:33:19 +0200 Subject: [PATCH] 0.6r5 --- lch | 2 +- lib/installer.sh | 11 ++++++++--- lib/installers/rpm.sh | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lch b/lch index b1e61bd..99a3f03 100755 --- a/lch +++ b/lch @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERSION=0.6r4 +VERSION=0.6r5 DEST=$1 shift 1 ORIG=$@ diff --git a/lib/installer.sh b/lib/installer.sh index c9bebce..002aedc 100644 --- a/lib/installer.sh +++ b/lib/installer.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash function rarInstall(){ - if [ -e "$(command -v wget)" ] + if [ -e "$(command -v wget)" ] || [ -e "$(command -v curl)" ] then if [[ "$(uname -m)" == "x86_64" ]] then @@ -11,7 +11,12 @@ 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 -q $RAR_URL > /dev/null + if [ -e "$(command -v wget)" ] + then + wget -q $RAR_URL > /dev/null + else + curl -s -o $RAR_FILE $RAR_URL > /dev/null + fi tar -zxvf $RAR_FILE > /dev/null cd rar cp -v rar unrar /usr/local/bin/ > /dev/null @@ -19,7 +24,7 @@ function rarInstall(){ 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" + echo -e "\n\e[91m[Error]\e[0m - wget or curl 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." fi } diff --git a/lib/installers/rpm.sh b/lib/installers/rpm.sh index 78ffc2b..6cdd9cd 100644 --- a/lib/installers/rpm.sh +++ b/lib/installers/rpm.sh @@ -3,7 +3,7 @@ # Functions function get_dep(){ - if [[ $@ -ne "p7zip-plugins" ]]; then + if [[ $@ == "p7zip-plugins" ]]; then yum install -y -q $@ 1> /dev/null else yum install -y -q $@ 1> /dev/null