contrib/freifunk-common: add watch.sh script to simulate the watch command
This commit is contained in:
parent
5c4a6b5e7d
commit
e0797183fe
1 changed files with 11 additions and 0 deletions
11
contrib/package/freifunk-common/files/usr/bin/watch.sh
Executable file
11
contrib/package/freifunk-common/files/usr/bin/watch.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue