summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/freifunk-common/files/usr/bin/watch.sh
blob: 728526b9e1339a87797ab01f888acd2d9acd3ca1 (plain)
1
2
3
4
5
6
7
8
9
10
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