#! /bin/sh case $1 in xs4all) /sbin/isdnctrl dial ippp0 sleep 5 /usr/local/bin/licq & wwwoffle -fetch >/dev/null echo "earl.xs4all.nl is connected to XS4ALL" ;; icq) /sbin/isdnctrl dial ippp0 sleep 5 wwwoffle -fetch >/dev/null echo "earl.xs4all.nl is connected to XS4ALL" echo "Starting ICQ..." /home/yuri/ICQJava/ICQ >/dev/null & ;; wbn) /sbin/isdnctrl dial ippp2 sleep 5 wwwoffle -fetch >/dev/null echo "earl.xs4all.nl is connected to WestBrabantNet" ;; off) repeat=1 while [ $repeat -eq 1 ] do mail=`netstat -A inet |grep 'yoda.dark4ce.com:smtp'\ |awk '{ print $6 }'` news=`netstat -A inet |grep 'yoda.dark4ce.com:nntp'\ |awk '{ print $6 }'` # Checking for open news/mail connection to ISP-servers if [ "${mail}" != "ESTABLISHED" ] && [ "${news}" != "ESTABLISHED" ] then repeat=0 echo "bSMTP Mail downloaded" # Checking for queued mail meelq=`ls /var/spool/mqueue` if [ "$meelq" != "" ] then echo "Sending Queued Mail..." /usr/sbin/sendmail -q fi # Checking for running ICQ (and killing it then) if [ -e "/tmp/ICQ.pid" ] then killall -9 java rm "/tmp/ICQ.pid" echo "ICQ killed" fi # Disconnecting for real now sleep 5 killall licq /sbin/isdnctrl hangup ippp0 /sbin/isdnctrl hangup ippp2 else # Wait for 10 seconds sleep 10 fi done ;; *) echo -e "\n Usage:\n 'isdn xs4all'\tTo connect to XS4ALL\n \ 'isdn wbn'\tTo connect to WestBrabantNet\n \ 'isdn icq'\tTo connect to XS4ALL and start ICQ\n \ 'isdn off'\tTo disconnect\n" ;; esac