LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2005, 03:10 PM   #1
amadkow
Member
 
Registered: May 2004
Location: CA, USA
Posts: 58

Rep: Reputation: 15
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
and it can log in it will not display anything but if it fails it will display "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".
 
Old 03-04-2005, 03:24 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 68
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
 
Old 03-04-2005, 03:38 PM   #3
amadkow
Member
 
Registered: May 2004
Location: CA, USA
Posts: 58

Original Poster
Rep: Reputation: 15
that doesn't see to use the results of the GET command it always it just compates the GET command it self ot "Invalid"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration