Mostrando entradas con la etiqueta OpenBSD. Mostrar todas las entradas
Mostrando entradas con la etiqueta OpenBSD. Mostrar todas las entradas

CheckHostAlive.bash

d
Nombre: CheckHostAlive.bash
Autor: @Tonejito
Descripción: Script que permite verificar si un host se encuentra arriba en la red,muestra un "0" si está arriba y un "1" si está abajo
Visto en: Tonejito
#!/bin/sh


# Check all hosts within the network
# BSD license


PING=/sbin/ping
SEQ=gseq


NET=192.168.2
ME=192.168.0.2


i=1;
while [ $i -le 254 ] ;
do
  $PING -v -D -s 8 -t 1 -w 1 -c 1 -I $ME $NET.$i 1>/dev/null
  printf "$?"
  i=`expr $i + 1` ;
done


printf "\n"
Permisos: chmod 700 CheckHostAlive.bash 
Ejecución: ./CheckHostAlive.bash.
Nota: El script mandará el ping del primer nódo al último [ 0-254 ]
Leer más...

pkg_find

d
Autor: Calomel.org
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
Leer más...