s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
6. How do I automate the connection procedure?Automated handling of news and email is quite easy to implement in Linux. First and foremost one should make a /usr/lib/ppp/ppp-on that initiates the ISP connection. Often, this file will simply contain the following:
Further specification will be performed in
/etc/ppp/options:
To end a connection, use the supplied version of /usr/lib/ppp/ppp-off. Having tested the functionality of these two scripts, one must then write scripts that perform the various tasks. The script to collect email has been described before, and we will here assume it is located at /home/dirk/pop. A script for exchange of email can then be produced in /root/mail:
The script to exchange news may be placed in /usr/lib/news/news:
A script to connect the various bits and pieces remains, and can
be placed in /root/news+mail:
It is quite easy to make an extension to the above that only will establish a connection if outgoing email and news is present. Lets call it /root/news+mail.cond, and keep in mind that the name of the outgoing news-spool must be updated to suit:
The only thing remaining is to specify when all this is going to
happen. This is done using the command
Ensure that every component is tested well before you connect
them together. One may later add several other tasks, such as
adjustment of the time of day (using
ntpdate), and automatic update (mirroring) of
locally maintained WWW and FTP files up to the ISP (using make
and ftp).
ALT: Depending on ones preferences, it is also possible
to turn the process upside down. Every time a PPP link is
initiated, the script
/etc/ppp/ip-up will be started. One may here add
whatever magic is required to start exchange of email and news.
See ALT: It is also possible to automatically connect PPP whenever network traffic is detected. This is in many ways the more elegant solution, but it is quite dependent on a good configuration to avoid frequent (and costly) connections being made. More information can be found at:
The
At the same location one will also find other variations on the theme PPP connections.
Next Previous Contents |