#!/bin/bash # exit status: # 1: connection alredy existing # 0: otherwise echo "establish connection to Internet" if [ ! "`/sbin/ifconfig |grep ppp0`" = "" ] then echo "connection exists." exit 1 fi wvdial 1>wvdial.log 2>&1 & echo "wait for connection" while [ "`/sbin/ifconfig |grep ppp0`" = "" ] do echo "waiting ..." sleep 7 done echo "connection established."