author | spiralman <spiralman> | 2002-10-18 21:16:13 (UTC) |
---|---|---|
committer | spiralman <spiralman> | 2002-10-18 21:16:13 (UTC) |
commit | 2ebb8c91374774171582f1a8ee4dbf4009a70615 (patch) (unidiff) | |
tree | df4f8164ddd6acb8e498d780d6d59756c4ce7940 | |
parent | 55a3c031fa5eba00a89ae5efa9b1d791eba9b9e7 (diff) | |
download | opie-2ebb8c91374774171582f1a8ee4dbf4009a70615.zip opie-2ebb8c91374774171582f1a8ee4dbf4009a70615.tar.gz opie-2ebb8c91374774171582f1a8ee4dbf4009a70615.tar.bz2 |
fixed hostlist.sh thanks to wolfgang enderlein, ping command fixed, and can now have comments in hostlist
-rwxr-xr-x | noncore/tools/opie-sh/scripts/hostlist.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/tools/opie-sh/scripts/hostlist.sh b/noncore/tools/opie-sh/scripts/hostlist.sh index 6575e9c..6d70793 100755 --- a/noncore/tools/opie-sh/scripts/hostlist.sh +++ b/noncore/tools/opie-sh/scripts/hostlist.sh | |||
@@ -19,20 +19,20 @@ | |||
19 | # | 19 | # |
20 | 20 | ||
21 | CFG=/opt/QtPalmtop/share/config/hostlist.cfg | 21 | CFG=/opt/QtPalmtop/share/config/hostlist.cfg |
22 | OPIE_SH=opie-sh | 22 | OPIE_SH=opie-sh |
23 | 23 | ||
24 | hostlist() { | 24 | hostlist() { |
25 | (echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/hostlist.png>" | 25 | (echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/hostlist.png>" |
26 | echo "<h3>Hostlist</h3><br>" | 26 | echo "<h3>Hostlist</h3><br>" |
27 | HOSTLIST=`cat $CFG` | 27 | HOSTLIST=`cat $CFG | grep -v '#'` |
28 | for HOST in $HOSTLIST | 28 | for HOST in $HOSTLIST |
29 | do | 29 | do |
30 | PT=` ping -c1 $HOST | grep avg|cut -d " " -f4-` | 30 | PT=` ping -c 1 $HOST | grep avg|cut -d " " -f4-` |
31 | if [ "$PT" != "" ] | 31 | if [ "$PT" != "" ] |
32 | then echo "<b><font color=#00ff00> " | 32 | then echo "<b><font color=#00ff00> " |
33 | echo "$HOST is up<br></font></b>[$PT]<br>" | 33 | echo "$HOST is up<br></font></b>[$PT]<br>" |
34 | else echo "<b><font color=#ff0000> " | 34 | else echo "<b><font color=#ff0000> " |
35 | echo "$HOST is down<br></font></b>[$PT]<br>" | 35 | echo "$HOST is down<br></font></b>[$PT]<br>" |
36 | fi | 36 | fi |
37 | done | 37 | done |
38 | ) | $OPIE_SH -t "Which are up ?" -f | 38 | ) | $OPIE_SH -t "Which are up ?" -f |