0.6 dev
This commit is contained in:
+19
-21
@@ -26,36 +26,34 @@ function rarInstall(){
|
||||
|
||||
function install()
|
||||
{
|
||||
echo -e "Install dependencies\n"
|
||||
|
||||
if [ "$UID" != "0" ]; then
|
||||
echo " Only root can execute this script, sorry."
|
||||
echo " Try 'sudo lch $@'"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -e "$(command -v rar)" ]
|
||||
then
|
||||
echo "rar installed."
|
||||
else
|
||||
read -p "Do you want to install non-free software? (rar, unrar) [Y/N]: " PRIVSOFT
|
||||
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)
|
||||
rarInstall;;
|
||||
n|N)
|
||||
echo -e "\nOnly will install free software.\n";;
|
||||
y | Y | yes)
|
||||
PRIVSOFT=true
|
||||
echo -e "\nInstall all dependencies (with non-free)\n";;
|
||||
*)
|
||||
echo -e "Options: 'Y' or 'N': ";;
|
||||
PRIVSOFT=false
|
||||
echo -e "\nOnly will install free software.\n";;
|
||||
esac
|
||||
else
|
||||
PRIVSOFT=false
|
||||
fi
|
||||
|
||||
if [ -x "$(command -v apt)" ]
|
||||
then
|
||||
echo -e "APT system detected\n"
|
||||
apt install -y tar bzip2 gzip zip unzip p7zip-full p7zip-rar 1> /dev/null
|
||||
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\n"
|
||||
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
|
||||
@@ -63,23 +61,23 @@ function install()
|
||||
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\n"
|
||||
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\n"
|
||||
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\n"
|
||||
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\n"
|
||||
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\n"
|
||||
echo -e "System installer not detected"
|
||||
fi
|
||||
|
||||
echo -e "\nDependencies installation finished\n"
|
||||
echo -e "Dependencies installation finished\n"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function
|
||||
|
||||
function install(){
|
||||
echo "$@:"
|
||||
# Busca la manera de capturar el error. Y mostrar mensaje en rojo.
|
||||
apt-get install -y $@ 1> /dev/null
|
||||
echo "e[32mInstalled\e[0m"
|
||||
}
|
||||
|
||||
# Run
|
||||
|
||||
echo -e "APT system detected"
|
||||
echo $@
|
||||
echo $1
|
||||
echo $0
|
||||
echo $PRIVSOFT
|
||||
echo "----------"
|
||||
|
||||
install $2
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
install tar
|
||||
install bzip2
|
||||
install gzip
|
||||
install zip
|
||||
install unzip
|
||||
install p7zip-full p7zip-rar
|
||||
else
|
||||
#Tropa
|
||||
|
||||
fi
|
||||
|
||||
# apt-get install -y tar bzip2 gzip zip unzip p7zip-full p7zip-rar 1> /dev/null
|
||||
Reference in New Issue
Block a user