Descripción: Script que nos permite instar paquetes Perl
#!/bin/bash
# Script para instalar paquetes en Perl.
function getch()
{
OLD_STTY=`stty -g`
stty cbreak -echo
look=`dd if=/dev/tty bs=1 count=1 2>/dev/null`
stty $OLD_STTY
}
function installModule()
{
sudo perl Makefile.PL
sudo make
sudo make test
sudo make install
}
function modins()
{
archivo=
select archivo in *.tar.gz "SALIR"
do
if [ "${archivo}" = "SALIR" ]
then
exit 0;
elif [[ -n "${archivo}" ]]
then
echo -e "Elegiste : ${archivo}";
tar zxvf "${archivo}" &> /dev/null || {
echo -e "Error descomprimiendo [ ${archivo} ]";
exit 1;
}
cd "${archivo%\.tar.gz}" 2> /dev/null || {
echo -e "\aError abriendo directorio ${archivo%%.*}";
exit 1;
}
installModule;
echo -e "\E[31;47mMódulo instalado. Presione una tecla para continuar.";
tput sgr0;
getch;
break;
else
echo -e "Error eligiendo archivo.";
exit 0;
fi
done
}
modins;
exit 0;
0 comentarios:
Publicar un comentario