Hi friends,
When I connect to net through a modem, I can check whether ppp0 is active or not using ifconfig command so that it will list the status of ppp0.
My problem is I had set a command in crontab as follows.
lynx -dump www.lcnet.com/update.php (A module to update the web mysql database)
Above script has to work and update only if ppp0 is active.
How can I check whether ppp0 is active (A script has to check and then if the status is true, update.php module has to execute).
Please suggest me how to go about.
I had put six to seven commands in a batch file and the batch file name is given in crontab. I am using wvdialer to connect to net and it redials if connection disconnect. and if I specify the dialing command "wvdial redial" in the batchfile, then the subsequent command in the batch file are not executing.
Regards,
Vinod.
On Wednesday 01 January 2003 05:51 am, Vinod wrote:
How can I check whether ppp0 is active (A script has to check and then if the status is true, update.php module has to execute).
#!/bin/sh ifconfig ppp0 > temp if [-z temp] then else <put ur script here> fi rm temp
Dear Bhargav, if ppp0 is not active,
the line ifconfig ppp0 > temp shows error.
what does [-z temp] function do ?
On Wed, 2003-01-01 at 16:48, Bhargav Bhatt wrote:
- LUG meet on 12 Jan. 2003 @ VJTI
On Wednesday 01 January 2003 05:51 am, Vinod wrote:
How can I check whether ppp0 is active (A script has to check and then if the status is true, update.php module has to execute).
#!/bin/sh ifconfig ppp0 > temp if [-z temp] then else <put ur script here> fi rm temp
On Thursday 02 January 2003 01:25 am, Vinod wrote:
Dear Bhargav, if ppp0 is not active,
the line ifconfig ppp0 > temp shows error.
Yes, and the temp file is created as empty.
what does [-z temp] function do ?
It evaluates to true if the file size is 0 (in the case of ppp0 being down)
But this seems to be a bit overkill. The approach others suggested seems simpler to implement and less prone to syntactic error. Try going with that. :-)
Hi guys,
I hv subscribed to no of mailing lists. Hence I get around 100 emails everyday. Thus to manage my emails I use procmail, so that my emails are filtered in to seperate folders as soon as they arrive.
But the problem is that procmail works for few days and then it stops working. Again it starts working after some days. This is irritating since when it is not working my default inbox is flooded with emails.
I ve been told that our procmail has been setup in such a way that I do not need to hv a .forward file in my home directory, only a .procmailrc file is enough.
I use mutt as my email client.
my .procmailrc file is as follows.
SHELL=/bin/sh PMDIR=/home/shashank/
LOGFILE=$PMDIR/log
LOG=" " ## VERBOSE=yes
# Set to no if you want minimal logging; default is all ## LOGABSTRACT=no
# Replace $HOME/Msgs with your mailbox directory # Mutt and elm use $HOME/Mail
MAILDIR=/home/shashank/Mail # Make sure this directory exists! DEFAULT=$MAILDIR/INBOX LOGFILE=$MAILDIR/.procmaillog LOCKFILE=$HOME/.lockmail
# INCLUDERC=$PMDIR/rc.testing # INCLUDERC=$PMDIR/rc.subscriptions
# Mail Filters
:0 * ^TO.shashank@hbcse.tifr.res.in $DEFAULT
:0 * ^Subject:.[ILUG-BOM] Mumbai-LUG
:0 * ^TO.*linuxers@mm.ilug-bom.org.in Mumbai-LUG
:0 * ^TO.*Indic-computing-users@lists.sourceforge.net Indic-Computing
:0 * ^TO.*semanticweb@yahoogroups.com Semantic-Web
:0 * ^TO.*debian-announce@lists.debian.org Debian-Mailing-List
:0 * ^TO.*gnowsys@lists.gnowledge.org gnowsys-Mailing-List
:0 * ^TO.*zope-dev@zope.org Zope-dev-Mailing-List
:0 * ^Subject:.[Zope-Dev] Zope-dev-Mailing-List
:0 * ^TO.*zope@zope.org Zope-Mailing-List
:0 * ^Subject:.[Zope]* Zope-Mailing-List
:0 * ^Subject:.[gnome-love]* Gnome-Love-Mailing-List
Thanx in advance
Shashank
On 02/01/03 09:21 +0530, "Shashank Ashtikar"@hbcse.tifr.res.in wrote:
I hv subscribed to no of mailing lists. Hence I get around 100 emails everyday. Thus to manage my emails I use procmail, so that my emails are filtered in to seperate folders as soon as they arrive.
But the problem is that procmail works for few days and then it stops working. Again it starts working after some days. This is irritating since when it is not working my default inbox is flooded with emails.
Any changes to the mail server config when procmail fails? The mail server should be using procmail as the LDA for a .procmailrc to work.
Devdas Bhagat
Hello vinod, good-evening.
This is quite simple. Just go thro the post dial ppp scripts. This should solve your issue.
/etc/ppp/ip-up /etc/ppp/ip-down
This should do the job mighty well. Just read them well and back 'em up before you start on anything adventurous.
Bye for now.
Trevor
On Wed, 2003-01-01 at 16:21, Vinod wrote:
- LUG meet on 12 Jan. 2003 @ VJTI
Hi friends,
When I connect to net through a modem, I can check whether ppp0 is active or not using ifconfig command so that it will list the status of ppp0.
My problem is I had set a command in crontab as follows.
lynx -dump www.lcnet.com/update.php (A module to update the web mysql database)
Above script has to work and update only if ppp0 is active.
How can I check whether ppp0 is active (A script has to check and then if the status is true, update.php module has to execute).
Please suggest me how to go about.
I had put six to seven commands in a batch file and the batch file name is given in crontab. I am using wvdialer to connect to net and it redials if connection disconnect. and if I specify the dialing command "wvdial redial" in the batchfile, then the subsequent command in the batch file are not executing.
Regards,
Vinod.
-- _______________________________________________
ifconfig would show u the ppp0 details
===== ninad purohit have a nice day :-)
________________________________________________________________________ Missed your favourite TV serial last night? Try the new, Yahoo! TV. visit http://in.tv.yahoo.com
Hi,
You can check for '/var/run/ppp-0.pid` file , if this file exsits then your ppp0 interface is up.
ciao n enjoy Tapesh
P.S I cannot remember the exact file name ......... so after getting online just search for .pid files in /var/run ( you will get the file)
--- Ninad Purohit ninadonline@yahoo.co.in wrote:
- LUG meet on 12 Jan. 2003 @ VJTI
ifconfig would show u the ppp0 details
===== ninad purohit have a nice day :-)
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Hey, No need to go into so many complications. Just remove the entry from cron and put the contents of the shell script in /etc/ppp/ip-up.local and make it executable by root.
Anil
Quoting Tapeshwar Nath gtapeshwar@yahoo.com:
- LUG meet on 12 Jan. 2003 @ VJTI
Hi,
You can check for '/var/run/ppp-0.pid` file , if this file exsits then your ppp0 interface is up.
ciao n enjoy Tapesh
P.S I cannot remember the exact file name ......... so after getting online just search for .pid files in /var/run ( you will get the file)
--- Ninad Purohit ninadonline@yahoo.co.in wrote:
- LUG meet on 12 Jan. 2003 @ VJTI
ifconfig would show u the ppp0 details
===== ninad purohit have a nice day :-)
Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
-- _______________________________________________