#!/bin/sh # This script is called from /etc/ppp/ip-up.local by pppd once # a connection comes up. # # Parameters are: # $1 = interface-name # $2 = tty-device # $3 = speed # $4 = local-link-local-address # $5 = remote-link-local-address # $6 = ipparam # # Write a notice to syslog logger "ip-up.plusnet: starting" if [ "$6" = "plusnet" ]; then # Plusnet connection activated # Set up Plusnet nameservers rm -f /etc/resolv.conf.pre-plusnet mv /etc/resolv.conf /etc/resolv.conf.pre-plusnet ( echo "search plus.com" [ -z "$DNS1" ] || echo "nameserver $DNS1" [ -z "$DNS2" ] || echo "nameserver $DNS2" ) > /etc/resolv.conf chmod 0644 /etc/resolv.conf logger "ip-up.plusnet: /etc/resolv.conf configured to use Plusnet nameservers" # Flush out the mail queues logger "ip-up.plusnet: flushing mail queues" sendmail -Ac -q sleep 3 sendmail -Am -q # Deliver any mail queued on PlusNet backup MX server logger "ip-up.plusnet: requesting SMTP mail queued on autoturn.plus.net" [ -x /usr/bin/finger ] && finger postmaster@autoturn.plus.net else # Some other pppd connection activated logger "ip-up.plusnet: non-PlusNet connection, aborting" fi # Write a notice to syslog logger "ip-up.plusnet: done"