Función: Realiza la búsqueda de un paquete determinado para su instalación.
#!/usr/local/bin/bash
#
## Calomel.org .:. pkg_find v0.07
#
## location of the local package listing file
packages=~/pkg_find_package_listing.html
export PKG_PATH=" [ ruta ftp | http ]"
if [ $# -eq 0 ]
then
echo ""
echo " Calomel.org .:. pkg_find"
echo "-------------------------------------"
echo "-u = update the local package listing."
echo "'string' = the package name or partial string of the package name you are looking for."
echo ""
exit
fi
if [ $1 = "-u" ]
then
echo " "
echo -e "\033[32m Download the package listing to $packages\033[0m"
echo " "
wget -O $packages $PKG_PATH
echo " "
exit
fi
if [ $1 = "$@" ]
then
if [ -e $packages ]
then
echo " "
echo -e "\033[32m Packages matching your query: $@\033[0m"
echo " "
cat $packages | grep -i $@ | cut -d\" -f6
echo " "
else
echo " "
echo -e "\033[32m $packages file does not exist. Run 'pkg_find -u' to update\033[0m"
echo " "
fi
exit
fi
0 comentarios:
Publicar un comentario