I wrote a small script that connects to my isp, then send and gets mail
and logs off. Maybe some of you on the list can use it too, so here it is:

(some configuration might be need for your system, so browse through it
first)

##################################################################
#!/bin/sh
# Small script that logs on to an isp, gets and sends mail and
# then logs off.
#
# Do NOT use this script with ppp-go. ppp-go requires you to
# press return after having established a connection. Using it
# would cause this script to keep waiting for the connection beeing
# established...
#
# If you run this as a normal user, make sure that the permissions for
# ppp are right:
# chmod +xs /usr/sbin/ppp-on
# chmod +xs /usr/sbin/ppp-off
#
# Karel Bemelmans <[EMAIL PROTECTED]>
# version 0.1  1/8/1998

echo "* Starting procedure."
echo ""

echo "* Logging on to ISP..."
echo ""

ppp-on
# You might want to play around with these values a bit
sleep 50

if /sbin/ifconfig | grep P-t-P >/dev/null ; then
 echo "* YES! connected... *"
 echo
 else
 echo "* Not connected yet... wating a bit more... *"
 echo
 # In case the 'sleep 50' wasn't long enough
 sleep 20
 if /sbin/ifconfig | grep P-t-P >/dev/null ; then
  echo "* YES! connected... *"
  else
  echo "* Giving up connection... *"
  echo
  exit
 fi
fi

echo "* Getting mail..."
# Change this to the popper you use
/usr/local/bin/fetchmail
echo

echo "* Sending mail..."
/usr/sbin/sendmail -q
echo

echo "* Done ! Now logging off..."
/usr/sbin/ppp-off

exit 0
#####################################################


   Karel Bemelmans, Narfum Inc.
   Home of the Belgian Punkrockers

  [-- Contact --] -->  [EMAIL PROTECTED]
  [-- Website --] -->  http://www.narfum.org

   - Waiter, try my soup.
   * Is something wrong sir ?
   - Just try my soup, waiter.
   * Ok. Where's the spoon ?
   - Ahhh....

Reply via email to