Prihlásiť sa Odoslať Novinky :: FAQ :: Rozšírené vyhľadávanie :: Napísali o nás :: Ankety
Main Menu
· Home
· 
· FAQ
· 
· Diskusia
· 











Main Menu
· Domov

Moduly
· AvantGo
· Downloads
· FAQ
· News
· Recommend Us
· Reviews
· Search
· Sections
· Stats
· Topics
· Top List
· Web Links
· Forum

Jazyk
Výber jazykovej mutácie:



The time now is 28.04.2024 - 17:10


ping.sh - vyriesene

Post new topic Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
 
Author Message
yeager
Post subject: ping.sh - vyriesene  PostPosted: 27.09.2007 - 21:38 #57430
Guru


Joined: Jún 19, 2005
Posts: 1019

da sa urobit tento skript bez awk?

#!/bin/sh
PING="/bin/ping"
# Google, for example
ADDR="google.com"
DATA=`$PING -c10 -s500 $ADDR -q `
LOSS=`echo $DATA | awk '{print $18 }' | tr -d %`
echo $LOSS
if [ $LOSS = 100 ];
then
echo 0
else
echo $DATA | awk -F/ '{print $5 }'
fi
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
yeager
Post subject: RE: ping.sh - vyriesene  PostPosted: 27.09.2007 - 23:16 #57432
Guru


Joined: Jún 19, 2005
Posts: 1019

thx GYRO

Code: ›
#!/bin/sh
 
 ADDR1="192.168.1.252";
 PING="/bin/ping";
 
  DATA=`$PING -c1 -s500 $ADDR1 -q`;
  LOSS=`echo $DATA | cut -d "," -f3 | tr -d "% packet loss"`;
  echo $LOSS;
 
  if [ $LOSS -gt 40 ]
   then
    echo ./reseter 30
   else
     echo Vsetko je ok
     fi
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
All times are GMT
Post new topic Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
 
Jump to:  

Powered by PNphpBB2 © 2003-2005 The PNphpBB Group
Credits

(C) SKFree 2002-2010: Powered by POSTNUKE. Môžete prebera? naše správy vo formáte XML(RSS)