For those who don't use KDE or Gnome but miss the PPP config utilities which setup ppp for use with
dynamic IP and
DNS assignment, I've come up with a script which does so. I use windowmaker and a little DOCKAPP called yawmppp to connect to the internet. If I hadn't already used kppp and made a note of the entries in /etc/ppp/resolv.conf, I would never be able to go on-line, since pppsetup only sets up for static
DNS. So I altered (some may say hacked) pppsetup in such a way that it writes the scripts and negotiates the connection providing
dynamic IP and
DNS. This script ISPSETUP is just a subset of the pppsetup that comes in slackware, so it won't misplace files or do weird things with any permissions. Enjoy!
#!/bin/bash
# ISPSETUP -- Script to set up pppd
# Based on PPPSETUP 1.98
# 12/12/03 GNA ISPSETUP is a subset of the script PPPSETUP (see History below).
# This script is designed to provide a simple interface to establish
# an internet connection in the simplest possible way. This script
# assumes that you will only be using only one connection, using a
# dial-up modem, with
Dynamic IP addressing,
Dynamic assignment of
# a Domain Name Server and PAP authentication. For other types of
# connections you should run the 'pppsetup' script instead of this.
# History:
# 7/21/95 RSL Script created (v1.0)
# 9/15/96 RSL Added code to get the ISP's domainname (v1.1)
# 9/19/96 RSL Revamped interface to use the 'dialog'
# program. (v1.2)
# 2/22/98 KR Added pap, chap, ms-chap, callback, &
# modem init string options. (v1.98)
# Creates /etc/ppp/options, & pap, chap,
# secrets files.
# More guidance.
# Monitor connection with tail & syslogd.
# Demand dialing setup with ppp-2.3.0 or later.
# 4/4/98 PJV Fixed massive /tmp-related security problems
# Switched to a default init string that's more
# likely to work
# Increased TIMEOUTs
# fixed bad flags given to chat -- caused dialout
# to fail
# 2/6/1999 PJV Changed all occurances of /dev/cua* to /dev/ttyS*
# 5/3/1999 PJV Commented 'debug' in /etc/ppp/options
# Add commented 'noauth' in /etc/ppp/options so
# people who want to use ppp but already have a
# default route have an easier time figuring out
# what to do.
# 6/18/2000 PJV Added code to check for "ppp-stop" and "ppp-on"
# symlinks, and make them if they don't exist.
# 5/19/2002 PJV Added support for more devices.
# 12/13/2003 GNA Major re-write to make simple connection script
# for newbies, and modern ISP's which usually use
# PAP authentication and
Dynamic Name Servers.
#
TMP=/var/log/setup/tmp
if [ ! "$UID" = "0" ]; then
echo
echo "NOTICE: * $LOGNAME * You need to be 'root' to run this script."
echo "You could login as: root"
echo "You could also try this: # sudo ispsetup"
echo "You could also try this: # su -c ispsetup"
echo "This assumes the permissions on 'sudo' and 'su' are 4111."
echo "To give 'su' or 'sudo' these permissions, you have to be root."
echo "~# chown root.root sudo ; chmod 4111 sudo"
echo "You also need a /etc/sudoers file for 'sudo'."
echo
exit 1
fi
if ! type -all "dialog" >/dev/null 2>&1 ; then
echo
echo "Can't find 'dialog', i can't run without 'dialog' on your system."
echo "You can get a compiled ELF version of 'dialog' from here."
echo "http://www.tux.org/pub/people/kent-robotti/index.html"
echo "ftp://ftp.tux.org/pub/people/kent-robotti 'dialog-0.9a.ELF.tar.gz'"
echo
exit 1
fi
SYS="for PHOENIX."
VERSION="1.0"
stty erase ^? 2>/dev/null
if [ ! -r /usr/sbin/ppp-stop ]; then
( cd /usr/sbin ; ln -sf ppp-off ppp-stop )
fi
if [ ! -r /usr/sbin/ppp-on ]; then
( cd /usr/sbin ; ln -sf ppp-go ppp-on )
fi
echo "ISPSETUP $VERSION $SYS" > $TMP/txtTEMP01
echo >> $TMP/txtTEMP01
echo "This script will help you set up your Internet connection. You will" >> $TMP/txtTEMP01
echo "need to know the phone number of your Internet Service Provider (ISP)," >> $TMP/txtTEMP01
echo "the username and password that your ISP gave you, and the location of" >> $TMP/txtTEMP01
echo "your modem. ISPSETUP will set up a single connection using
Dynamic IP" >> $TMP/txtTEMP01
echo "and
DNS addressing, and PAP authorization, since these are the most" >> $TMP/txtTEMP01
echo "common options. For any other kind of connection you should run the." >> $TMP/txtTEMP01
echo "pppsetup script.ISPSETUP is a subset of PPPSETUP which was written by" >> $TMP/txtTEMP01
echo "Robert S. Liesenfeld, with changes by Kent Robotti and Patrick " >> $TMP/txtTEMP01
echo "Volkerding. ISPSETUP by Gilbert Ashley <gnashley@earthlink.net>." >> $TMP/txtTEMP01
echo >> $TMP/txtTEMP01
echo "Press [Enter] to continue with pppsetup..." >> $TMP/txtTEMP01
dialog --backtitle "ISPSETUP $VERSION/Phoenix" --textbox "$TMP/txtTEMP01" 18 75
while [ -z "$PHONENUM" ]
do
echo >> $TMP/txtTEMP$$
echo "What is the phone number of your Internet Service Provider?" >> $TMP/txtTEMP$$
echo >> $TMP/txtTEMP$$
echo "Do not use any dashes,dots or spaces between the numbers." >> $TMP/txtTEMP$$
echo >> $TMP/txtTEMP$$
echo "In the USA, if you have call-waiting you should add '70,' before the" >> $TMP/txtTEMP$$
# echo >> $TMP/txtTEMP$$
echo "number. Example: 70,6543210 (comma required)" >> $TMP/txtTEMP$$
echo >> $TMP/txtTEMP$$
dialog --title "PHONE NUMBER ..." --inputbox "`cat $TMP/txtTEMP$$`" 18 75 2> $TMP/rspTEMP$$
if [ $? = 1 ]; then
rm -f $TMP/*TEMP*
clear 2>/dev/null || echo
echo "ISP configuration cancelled."
exit
fi
PHONENUM="`cat $TMP/rspTEMP$$`"
if [ -z "$PHONENUM" ]; then
clear 2>/dev/null || echo
rm -f $TMP/*TEMP*
echo "ISP configuration cancelled."
echo "No phone number."
exit
fi
done
echo "Where is your modem /dev/ttyS?" > $TMP/txtTEMP$$
dialog --backtitle "MODEM DEVICE ..." --menu "`cat $TMP/txtTEMP$$`" 17 60 10 \
modem "= use whatever /dev/modem is linked to" \
ttyS0 "= (COM1: under DOS)" \
ttyS1 "= (COM2: under DOS)" \
ttyS2 "= (COM3: under DOS)" \
ttyS3 "= (COM4: under DOS)" \
ttyS4 "= PCI modem" \
ttyS5 "= PCI modem" \
ttyS6 "= PCI modem" \
ttyS7 "= PCI modem" \
ttyS8 "= PCI modem" \
ttyS9 "= PCI modem" \
ttyS10 "= PCI modem" \
ttyS11 "= PCI modem" \
ttyS12 "= PCI modem" \
ttyS13 "= PCI modem" \
ttyS14 "= PCI modem" \
ttyS15 "= PCI modem" \
2> $TMP/rspTEMP$$
MODEM="`cat $TMP/rspTEMP$$`"
if [ ! "$MODEM" = "modem" ]; then
if [ -z $MODEM ]; then
clear 2>/dev/null || echo
rm -f $TMP/*TEMP*
echo "ISP configuration cancelled."
exit
elif [ ! -c "/dev/$MODEM" ]; then
/dev/MAKEDEV $MODEM >/dev/null 2>&1 || MODERROR="YES"
else
rm -f /dev/modem 2>/dev/null
ln -sf /dev/$MODEM /dev/modem 2>/dev/null
fi
fi
echo "What baud rate is your modem?" > $TMP/txtTEMP$$
echo >> $TMP/txtTEMP$$
echo "Usually you should choose a rate higher than your modem speed." >> $TMP/txtTEMP$$
echo "For instance, if you have a 56K modem, try 115200." >> $TMP/txtTEMP$$
dialog --backtitle "MODEM BAUD RATE ..." --menu "`cat $TMP/txtTEMP$$`" 18 72 7 \
230400 "230KBps - 56Kbps modem..." \
115200 "115KBps - 56Kbps modem..." \
57600 "57.6KBps - 33.6, or 56Kbps modem..." \
38400 "38.4KBps - 28.8 or 33.6..." \
19200 "19.2KBps - Better known as 14.4..." \
9600 "9600bps - No comment..." 2> $TMP/rspTEMP$$
BAUDRATE="`cat $TMP/rspTEMP$$`"
if [ -z $BAUDRATE ]; then
clear 2>/dev/null || echo
rm -f $TMP/*TEMP*
echo "ISP configuration cancelled."
exit
fi
INIT="default"
echo "Put the Username or Login name given to you by your ISP in the box below." > $TMP/txtTEMP1
echo >> $TMP/txtTEMP1
echo "Usually this is your username or number followed" >> $TMP/txtTEMP1
echo "by their @domain name like this:" >> $TMP/txtTEMP1
echo "Example:
jerry@foo.boo.com" >> $TMP/txtTEMP1
echo "Example:
1234567@foo.boo.com" >> $TMP/txtTEMP1
echo >> $TMP/txtTEMP1
echo "If you use net-by-call it might be something like:" >> $TMP/txtTEMP1
echo "Example: surf@easysurf4you" >> $TMP/txtTEMP1
echo >> $TMP/txtTEMP1
dialog --backtitle "USERNAME or LOGIN? ..." --inputbox "`cat $TMP/txtTEMP1`" 19 64 2> $TMP/rspTEMP$$
if [ $? = 1 ]; then
rm -f $TMP/*TEMP*
clear 2>/dev/null || echo
echo "ISP configuration cancelled."
fi
USERNAME="`cat $TMP/rspTEMP$$`"
echo "What's the password for the username above?" >> $TMP/txtTEMP2
echo "Example: Xpi9u87T" >> $TMP/txtTEMP2
dialog --backtitle "PAP PASSWORD? ..." --inputbox "`cat $TMP/txtTEMP2`" 10 64 2> $TMP/rspTEMP$$
PASSWORD="`cat $TMP/rspTEMP$$`"
if [ -x /usr/sbin/pppd ]; then
PATH1="/usr/sbin/pppd"
elif [ -x /usr/bin/pppd ]; then
PATH1="/usr/bin/pppd"
elif [ -x /usr/local/bin/pppd ]; then
PATH1="/usr/local/bin/pppd"
elif [ -x /bin/pppd ]; then
PATH1="/bin/pppd"
elif [ -x /sbin/pppd ]; then
PATH1="/sbin/pppd"
else
PATH1="pppd"
fi
if [ -x /usr/sbin/chat ]; then
PATH2="/usr/sbin/chat"
elif [ -x /usr/bin/chat ]; then
PATH2="/usr/bin/chat"
elif [ -x /usr/local/bin/chat ]; then
PATH2="/usr/local/bin/chat"
elif [ -x /bin/chat ]; then
PATH2="/bin/chat"
elif [ -x /sbin/chat ]; then
PATH2="/sbin/chat"
else
PATH2="chat"
fi
if [ ! -s $TMP/cb1TEMP$$ ]; then
echo "TIMEOUT 90" > /etc/ppp/pppscript
echo "ABORT ERROR" >> /etc/ppp/pppscript
echo "ABORT BUSY" >> /etc/ppp/pppscript
echo 'ABORT "NO CARRIER"' >> /etc/ppp/pppscript
echo 'ABORT "NO DIALTONE"' >> /etc/ppp/pppscript
if [ "$INIT" = "default" ]; then
echo '"" "ATM1L1"' >> /etc/ppp/pppscript
echo 'OK "'ATDT$PHONENUM'"' >> /etc/ppp/pppscript
else
echo '"" '$INIT'' >> /etc/ppp/pppscript
echo '"'ATDT$PHONENUM'"' >> /etc/ppp/pppscript
fi
echo "TIMEOUT 90" >> /etc/ppp/pppscript
echo 'CONNECT '$END'' >> /etc/ppp/pppscript
chown root.root /etc/ppp/pppscript 2>/dev/null
chmod 600 /etc/ppp/pppscript 2>/dev/null
fi
if [ -s $TMP/sayTEMP1 ]; then
cat $TMP/sayTEMP1 >> /etc/ppp/pppscript
echo >> /etc/ppp/pppscript
else
echo >> /etc/ppp/pppscript
fi
if [ -s /etc/ppp/ip-up ]; then
mv /etc/ppp/ip-up /etc/ppp/ip-up.OLD
fi
echo "#!/bin/sh" > /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# This file /etc/ppp/ip-up is run by pppd when there's a" >> /etc/ppp/ip-up
echo "# successful ppp connection." >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# Put any commands you want run after a successful connection" >> /etc/ppp/ip-up
echo "# in this file." >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# Any commands you want printed to the screen should be directed" >> /etc/ppp/ip-up
echo "# to: >/dev/tty0" >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# Other commands should not be directed to: >/dev/tty0" >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# The companion file is /etc/ppp/ip-down, it's run when the PPP" >> /etc/ppp/ip-up
echo "# connection ends." >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# This file is created when you run ispsetup: `date 2>/dev/null`" >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# The environment is cleared before executing this script" >> /etc/ppp/ip-up
echo "# so the path must be reset." >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "PATH=/usr/bin:/usr/sbin:/usr/local/bin:/sbin:/bin" >> /etc/ppp/ip-up
echo "export PATH" >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "# This will print to the screen the local & remote IP address when you" >> /etc/ppp/ip-up
echo '# make a successful ppp connection. $4 = Local IP $5 = Remote IP' >> /etc/ppp/ip-up
echo "#" >> /etc/ppp/ip-up
echo "# The CARRIER speed at which you connected will be reported, if it's in" >> /etc/ppp/ip-up
echo '# the /var/log/messages file. You also need the programs "tail" "cut"' >> /etc/ppp/ip-up
echo '# "tr" "grep" and "syslogd" running for this to work.' >> /etc/ppp/ip-up
echo "# You may have to add S95=46 to your modem init string" >> /etc/ppp/ip-up
echo "# to get your modem to report the DCE = CARRIER speed." >> /etc/ppp/ip-up
echo "# Example: AT&FS95=46" >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "if [ -s /var/log/messages ] && ( ps xc 2>/dev/null | grep -q syslogd 2>/dev/null ); then" >> /etc/ppp/ip-up
echo 'S=`tail -n 30 /var/log/messages 2>/dev/null | grep "CARRIER[^)]" 2>/dev/null | tr -d "^M" 2>/dev/null | cut -d: -f4 2>/dev/null`' >> /etc/ppp/ip-up
echo 'echo -n "$S" >/dev/tty0' >> /etc/ppp/ip-up
echo 'echo " Local: $4 -> Remote: $5 $1" >/dev/tty0' >> /etc/ppp/ip-up
echo "else" >> /etc/ppp/ip-up
echo 'echo " Local: $4 -> Remote: $5 $1" >/dev/tty0' >> /etc/ppp/ip-up
echo "fi" >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "# If you want to ping the other end to keep the connection open." >> /etc/ppp/ip-up
echo "# The output from ping will goto >/dev/null, you won't see it." >> /etc/ppp/ip-up
echo '# Ping -i 60 = send ping every 60 seconds to remote = $5.' >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo '(ping -i 60 $5 &) >/dev/null 2>&1' >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "# This makes a symbolic link from /etc/resolv.conf to /etc/ppp/resolv.conf." >> /etc/ppp/ip-up
echo "# It will be removed by /etc/ppp/ip-down." >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo 'ln -s /etc/ppp/resolv.conf /etc/resolv.conf' >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "# If you want sendmail to send any mail in /var/spool/mqueue when" >> /etc/ppp/ip-up
echo "# you connect, remove the # below." >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "#sendmail -q" >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "# If you want fetchmail to get your mail when you connect and check" >> /etc/ppp/ip-up
echo "# every 300 seconds = 5 minutes for mail, remove the # below." >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "#fetchmail -d 300" >> /etc/ppp/ip-up
echo >> /etc/ppp/ip-up
echo "# End..." >> /etc/ppp/ip-up
chmod 755 /etc/ppp/ip-up 2>/dev/null
if [ -s /etc/ppp/ip-down ]; then
mv /etc/ppp/ip-down /etc/ppp/ip-down.OLD
fi
==========================================================
On trying to post, it was too long so I'll have to put the rest in another post. Sorry!