#!/usr/bin/env bash
|
|
|
|
function rarInstall(){
|
|
if [ -e "$(command -v wget)" ]
|
|
then
|
|
if [[ "$(uname -m)" == "x86_64" ]]
|
|
then
|
|
RAR_URL="https://www.rarlab.com/rar/rarlinux-x64-5.9.1.tar.gz"
|
|
RAR_FILE="rarlinux-x64-5.9.1.tar.gz"
|
|
else
|
|
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
|
|
tar -zxvf $RAR_FILE > /dev/null
|
|
cd rar
|
|
cp -v rar unrar /usr/local/bin/ > /dev/null
|
|
cd ..
|
|
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."
|
|
fi
|
|
}
|
|
|
|
function install()
|
|
{
|
|
if [ "$UID" != "0" ]; then
|
|
echo " Only root can execute this script, sorry."
|
|
echo " Try 'sudo lch $@'"
|
|
exit 0
|
|
fi
|
|
|
|
if [ $# -eq 1 ]; then
|
|
# Poner aviso "Vamos a instalarlo todo y mucho"
|
|
read -p "Do you want to install non-free software? (rar, unrar) [y/N]: " PRIVSOFT
|
|
case ${PRIVSOFT} in
|
|
y | Y | yes)
|
|
PRIVSOFT=true
|
|
echo -e "\nInstall all dependencies (with non-free)\n";;
|
|
*)
|
|
PRIVSOFT=false
|
|
echo -e "\nOnly will install free software.\n";;
|
|
esac
|
|
else
|
|
PRIVSOFT=false
|
|
fi
|
|
|
|
if [ -x "$(command -v apt)" ]
|
|
then
|
|
if [[ -e ./lib/installers/apt.sh ]]; then . ./lib/installers/apt.sh; else . /usr/lib/lch/installers/apt.sh; fi
|
|
# Hasta aqui he modificado
|
|
elif [ -n "$(grep "centos" /etc/*-release)" ]
|
|
then
|
|
echo -e "CentOS system detected"
|
|
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
|
|
yum install -y -q tar bzip2 gzip zip unzip p7zip p7zip-plugins 1> /dev/null
|
|
elif [ -x "$(command -v dnf)" ]
|
|
then
|
|
echo -e "DNF system detected"
|
|
dnf install -y -q tar bzip2 gzip zip unzip p7zip p7zip-plugins 1> /dev/null
|
|
elif [ -x "$(command -v yum)" ]
|
|
then
|
|
echo -e "Yum system detected"
|
|
yum install -y -q tar bzip2 gzip zip unzip p7zip p7zip-plugins 1> /dev/null
|
|
elif [ -x "$(command -v pacman)" ]
|
|
then
|
|
echo -e "Pacman system detected"
|
|
pacman -Sqy --noconfirm tar bzip2 gzip zip unzip p7zip 1> /dev/null
|
|
elif [ -x "$(command -v zypper)" ]
|
|
then
|
|
echo -e "Zypper system detected"
|
|
zypper install -y tar bzip2 gzip zip unzip p7zip-full 1> /dev/null
|
|
else
|
|
echo -e "System installer not detected"
|
|
fi
|
|
|
|
echo -e "\nDependencies installation finished\n"
|
|
}
|