help with shell script
I am trying to make a script that will notify me if it can't logon to a website.
So far I found if I run Code:
GET "http://nexpart.com/do_login.php?nexpartuname=username&pwd=password" |grep -o Invalid My problem is building a script that checks to see if it gets "Invalid" and then e-mails me or somthing if it gets "Invalid". |
You could use:
#!/bin/bash output=`GET "http://nexpart.com/do_login.php?nexpartuname=username&pwd=password" |grep -o Invalid` if [ "$output" == "Invalid" ];then echo Could connect else echo Unable to connect | mail you@domain.com fi |
that doesn't see to use the results of the GET command it always it just compates the GET command it self ot "Invalid"
|
All times are GMT -5. The time now is 03:58 PM. |