[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

adsl.inittab - dlaczego nie działa?



Poniższy skrypt służy do uruchomienia Neostrady (modem Sagem800) i
wznowienia połączenia po jego zerwaniu.
Niestety modem nie startuje, non-stop otrzymuję komunikat "[:53:==:
unexpected operator".
Ktoś może pomóc?
Z góry dziękuję,
Krzysiek



#!/bin/sh

##############################################################
#
# Connection script for use with inittab.
#
# To install, add the following line in the /etc/inittab file:
#
# adsl:2345:respawn:/usr/sbin/adsl.inittab
#
##############################################################

# if /var/run/adiusbadsl doesn't exist or if it contains STOPPED,
# connexion is not restarted
STOPPED=0
if [ -f /var/run/adiusbadsl ] ; then
	if grep -q "STOPPED" /var/run/adiusbadsl ; then
		STOPPED=1
	fi
fi

# pppd is already launched ? => exit
if [ `pidof pppd` ] ; then
	STOPPED=1
fi

if [ $STOPPED = 0 ] ; then
#	logger "adsl.inittab est lancé!"
	echo "STARTED" > /var/run/adiusbadsl
	# Wait for modem "operational" state:
	while true ; do
		/usr/sbin/adictrl -s
		if [ $? == 0 ] ; then break; fi
		# Wait a little to let hotplug load the firmware
		# to the modem:
		sleep 2
	done

	# Get the ADI network interface name:
	INTERFACE=`/usr/sbin/adictrl -i 2>/dev/null`

	# Configure the ADI network interface:
	/sbin/ifconfig $INTERFACE 192.168.60.30 netmask 255.255.255.0 up

	# Start pppd:
	/usr/sbin/pppd nodetach persist pty "/usr/sbin/pppoa -I $INTERFACE"
file /etc/ppp/options.adsl

	# Remove the ADI network interface:
	/sbin/ifconfig $INTERFACE down
else
#	logger "on attend"
	sleep 30
fi





Reply to: