From: Manuel Munz Date: Wed, 30 May 2012 18:26:09 +0000 (+0000) Subject: contrib/freifunk-common: add watch.sh script to simulate the watch command X-Git-Tag: 0.11.0~668 X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=e0797183feb485dcc0070f69a654c10b457cb61b;p=project%2Fluci.git contrib/freifunk-common: add watch.sh script to simulate the watch command --- diff --git a/contrib/package/freifunk-common/files/usr/bin/watch.sh b/contrib/package/freifunk-common/files/usr/bin/watch.sh new file mode 100755 index 000000000..728526b9e --- /dev/null +++ b/contrib/package/freifunk-common/files/usr/bin/watch.sh @@ -0,0 +1,11 @@ +#!/bin/sh +command="$1" +interval="$2"; [ -z "$interval" ] && interval=1 + +if [ -z $command ]; then + echo 'Usage: watch.sh "command [options]" [interval], e.g. watch "ifconfig ath0" 2' + echo 'interval is optional and defaults to 1' + exit 1 +fi + +while true; do clear; $command; sleep $interval; done