Tag Archives | Bash

Driftnet – misc scripts

#!/bin/bash mpixW=250 mpixH=300 if [ "x`which identify`" != x ] ; then echo `which identify` found! echo Tossing images less than $mpixW pixels. while true ; do read img imgType=$( expr `identify -format ‘%e’ “$img”` ) if [ "$imgType" == "jpeg" ] ; then sizeW=$( expr `identify -format ‘%w’ “$img”` ) sizeH=$( expr `identify -format […]

Continue Reading 0

Broadvoice – Fastest proxy switcher for asterisk.

#!/bin/bash curhip=(`cat /etc/hosts | grep sip.broadvoice.com | awk ‘{ print $1 }’`) echo “Current IP: $curhip” chkip=”(`ping -c 2 sip.broadvoice.com`)” curiplow=(`echo $chkip | grep PING | grep -Eo ‘\b[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\b’ | uniq`) curlow=(`echo $chkip | grep -o ‘time\s[0-9]\+[^ms]‘ | awk ‘{ print $2 }’`) function getnewlow { echo “Testing: $1″ chkip=”(`ping -c 2 $1`)” curip=(`echo $chkip […]

Continue Reading 0

Powered by recycled bites and bytes.