LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 716|回复: 5

紧急问题阿,头大死了

[复制链接]
发表于 2004-11-29 11:05:09 | 显示全部楼层 |阅读模式
ADSL做得BBS,但是由于ADSL是动态IP的问题,所以论坛经常上不上,我我已经根据论坛的帖子设置如下了:
#! /bin/bash
# Generated automatically from adsl-start.in by configure.
#***********************************************************************
#
# adsl-start
#
# Shell script to bring up an ADSL connection
#
# Copyright © 2000 Roaring Penguin Software Inc.
#
# $Id: adsl-start.in,v 1.7 2001/06/25 15:00:47 dfs Exp $
#
# This file may be distributed under the terms of the GNU General
# Public License.
#
# Usage: adsl-start [config_file]
# adsl-start interface user [config_file]
# Second form overrides USER and ETH from config file.
# If config_file is omitted, defaults to /etc/ppp/pppoe.conf
#
#***********************************************************************

# From AUTOCONF
prefix=/usr
exec_prefix=/usr

# Paths to programs
CONNECT=/sbin/adsl-connect
ECHO=/bin/echo
IFCONFIG=/sbin/ifconfig
LS=/bin/ls
NETWORKDIR=/etc/sysconfig/network-scripts

get_device() {
if [ ! -d $NETWORKDIR ] ; then
$ECHO "** $NETWORKDIR not found"
$ECHO "** Quitting"
exit 1
fi

cd $NETWORKDIR
interfaces=$($LS ifcfg-ppp* 2>/dev/null | egrep -v '(~|\.bak)$' | \
egrep -v '(rpmsave|rpmorig|rpmnew)' | sed 's/^ifcfg-//g')

for i in $interfaces ; do
test -f ifcfg-$i && . ifcfg-$i 2>/dev/null
if [ "$TYPE" = "xDSL" ] ; then
CONFIG=$NETWORKDIR/ifcfg-$i
break
fi
done
}

# Set to "C" locale so we can parse messages from commands
LANG=C
export LANG

# Defaults
USER=""
ETH=""
ME=`basename $0`

# Must be root
if [ "`/usr/bin/id -u`" != 0 ] ; then
[ "$DEBUG" = "1" ] && $ECHO "$ME: You must be root to run this script" >& 2
exit 1
fi

# Debugging
if [ "$DEBUG" = "1" ] ; then
$ECHO "*** Running in debug mode... please be patient..."
DEBUG=/tmp/pppoe-debug-$$
export DEBUG
mkdir $DEBUG
if [ "$?" != 0 ] ; then
$ECHO "Could not create directory $DEBUG... exiting"
exit 1
fi
DEBUG=$DEBUG/pppoe-debug.txt

# Initial debug output
$ECHO "---------------------------------------------" > $DEBUG
$ECHO "* The following section contains information about your system" >> $DEBUG
date >> $DEBUG
$ECHO "Output of uname -a" >> $DEBUG
uname -a >> $DEBUG
$ECHO "---------------------------------------------" >> $DEBUG
$ECHO "* The following section contains information about your network" >> $DEBUG
$ECHO "* interfaces. The one you chose for PPPoE should contain the words:" >> $DEBUG
$ECHO "* 'UP' and 'RUNNING'. If it does not, you probably have an Ethernet" >> $DEBUG
$ECHO "* driver problem." >> $DEBUG
$ECHO "Output of ifconfig -a" >> $DEBUG
$IFCONFIG -a >> $DEBUG
$ECHO "---------------------------------------------" >> $DEBUG
if [ "`uname -s`" = "Linux" ] ; then
$ECHO "* The following section contains information about kernel modules" >> $DEBUG
$ECHO "* If the module for your Ethernet card is 'tulip', you might" >> $DEBUG
$ECHO "* want to look for an updated version at http://www.scyld.com" >> $DEBUG
$ECHO "Output of lsmod" >> $DEBUG
lsmod >> $DEBUG
$ECHO "---------------------------------------------" >> $DEBUG
fi
$ECHO "* The following section lists your routing table." >> $DEBUG
$ECHO "* If you have an entry which starts with '0.0.0.0', you probably" >> $DEBUG
$ECHO "* have defined a default route and gateway, and pppd will" >> $DEBUG
$ECHO "* not create a default route using your ISP. Try getting" >> $DEBUG
$ECHO "* rid of this route." >> $DEBUG
$ECHO "Output of netstat -n -r" >> $DEBUG
netstat -n -r >> $DEBUG
$ECHO "---------------------------------------------" >> $DEBUG
$ECHO "Contents of /etc/resolv.conf" >> $DEBUG
$ECHO "* The following section lists DNS setup." >> $DEBUG
$ECHO "* If you can browse by IP address, but not name, suspect" >> $DEBUG
$ECHO "* a DNS problem." >> $DEBUG
cat /etc/resolv.conf >> $DEBUG
$ECHO "---------------------------------------------" >> $DEBUG
$ECHO "* The following section lists /etc/ppp/options." >> $DEBUG
$ECHO "* You should have NOTHING in that file." >> $DEBUG
$ECHO "Contents of /etc/ppp/options" >> $DEBUG
cat /etc/ppp/options >> $DEBUG 2>/dev/null
$ECHO "---------------------------------------------" >> $DEBUG
DEBUG="1"
fi

# Sort out command-line arguments
case "$#" in
1)
CONFIG="$1"
;;
3)
CONFIG="$3"
;;
esac

if [ -z "$CONFIG" ] ; then
get_device
[ -z "$CONFIG" ] && CONFIG=/etc/ppp/pppoe.conf
fi

if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
[ "$DEBUG" = "1" ] && $ECHO "$ME: Cannot read configuration file '$CONFIG'" >& 2
exit 1
fi

. $CONFIG

# Check for command-line overriding of ETH and USER
case "$#" in
2|3)
ETH="$1"
USER="$2"
;;
esac

# Check for pidfile
if [ -r "$PIDFILE" ] ; then
PID=`cat "$PIDFILE"`
# Check if still running
kill -0 $PID > /dev/null 2>&1
if [ $? = 0 ] ; then
[ "$DEBUG" = "1" ] && $ECHO "$ME: There already seems to be an ADSL connection up (PID $PID)" >& 2
exit 1
fi
# Delete bogus PIDFILE
rm -f "$PIDFILE" "$PIDFILE.pppd" "$PIDFILE.pppoe" "$PIDFILE.start"
fi

echo $$ > $PIDFILE.start

# Start the connection in the background unless we're debugging
if [ "$DEBUG" = "1" ] ; then
$CONNECT "$@"
exit 0
fi

$CONNECT "$@" > /dev/null 2>&1 &
CONNECT_PID=$!

if [ "$CONNECT_TIMEOUT" = "" -o "$CONNECT_TIMEOUT" = 0 ] ; then
exit 0
fi

# Don't monitor connection if dial-on-demand
if [ "$DEMAND" != "" -a "$DEMAND" != "no" ] ; then
exit 0
fi

# Monitor connection
TIME=0
while [ true ] ; do
/sbin/adsl-status $CONFIG > /dev/null 2>&1

# Looks like the interface came up
if [ $? = 0 ] ; then
# Print newline if standard input is a TTY
[ "$DEBUG" = "1" ] && tty -s && $ECHO " Connected!"
/usr/sbin/ez-ipupdate -i ppp0 -h diypark.3322.org -S qdns -u 用户名:密码
exit 0
fi

if test -n "$FORCEPING" ; then
[ "$DEBUG" = "1" ] && $ECHO -n "$FORCEPING"
else
[ "$DEBUG" = "1" ] && tty -s && $ECHO -n "$PING"
fi
sleep $CONNECT_POLL
TIME=`expr $TIME + $CONNECT_POLL`
if [ $TIME -gt $CONNECT_TIMEOUT ] ; then
break
fi
done

[ "$DEBUG" = "1" ] && $ECHO "TIMED OUT" >& 2
# Timed out! Kill the adsl-connect process and quit
kill $CONNECT_PID > /dev/null 2>&1

# Clean up PIDFILE(s)
rm -f "$PIDFILE" "$PIDFILE.pppd" "$PIDFILE.pppoe" "$PIDFILE.start"

exit 1

但是段流后他不会自动执行adsl-start这个命令,他现在显示的是
[root@server1 sbin]# No response to 3 echo-requests
Serial link appears to be disconnected.
Connection terminated.
Connect time 75.4 minutes.
Sent 30 bytes, received 25246970 bytes.
pppoe: read (asyncReadFromPPP): Session 247: Input/output error
不晓得如何解决,域名指向的IP他不会自动更新
 楼主| 发表于 2004-11-30 13:18:21 | 显示全部楼层
有人能帮帮忙吗
发表于 2004-11-30 13:37:29 | 显示全部楼层
我也想知道啊
帮你顶下!
发表于 2004-11-30 15:51:39 | 显示全部楼层
建议兄弟你看看接压缩后的说明文件README:
里面有注明:修改/etc/ppp/ip-up  
将/usr/sbin/ez-ipupdate -i ppp0 -h diypark.3322.org -S qdns -u 用户名:密码
加到后面,如果是Redhat要加到“exit 0"之前。
看你很眼熟,是不是RHCE 8月份那一期的?
 楼主| 发表于 2004-12-1 08:43:21 | 显示全部楼层
.......这个你都知道阿,我是文华8月班的,准备这个月考试啦,不过心里还没底,嗨..先考考再说,那个说明档我已经加了,我再去看看,也许路径不对
 楼主| 发表于 2004-12-6 09:19:57 | 显示全部楼层
who can help me!5555555
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表