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

Re: ethernet on laptop



[...]
> A low tone instead of a beep indicates an error.
I heard no tone at all.
> 
> As root type cardctl info (I believe, check the help) will tell you about the
> cards it sees.

I got the message open_sock(): operation not supported by device

I have no idea what this means but to help I'll attach some files.

Patrick Kirk

Diplomacy is the art of saying "nice doggy" until you can find a rock.
#! /bin/sh
#
# network 1.45 1998/08/20 23:01:07 (David Hinds)
#
# Initialize or shutdown a PCMCIA ethernet adapter
#
# This script should be invoked with two arguments.  The first is the
# action to be taken, either "start", "stop", or "restart".  The
# second is the network interface name.
#
# The script passes an extended device address to 'network.opts' in
# the ADDRESS variable, to retrieve device-specific configuration
# options.  The address format is "scheme,socket,instance,hwaddr"
# where "scheme" is the current PCMCIA device configuration scheme,
# "socket" is the socket number, "instance" is used to number multiple
# interfaces in a single socket, and "hwaddr" is the card's hardware
# ethernet address.
#

. ./shared

# Get device attributes
get_info $DEVICE
HWADDR=`/sbin/ifconfig $DEVICE | sed -n -e 's/.*addr \([0-9A-F:]*\) */\1/p'`

# Load site-specific settings
ADDRESS="$SCHEME,$SOCKET,$INSTANCE,$HWADDR"
start_fn () { return; }
stop_fn () { return; }
. $0.opts

RESOLV=/etc/resolv.conf

case "$ACTION" in

'start')

    test "$IF_PORT" && /sbin/ifport $DEVICE $IF_PORT

    if is_true $BOOTP ; then
	/sbin/ifconfig $DEVICE up
	/sbin/route add default dev $DEVICE
	eval `/sbin/bootpc --returniffail --bootfile '' --dev $DEVICE`
	/sbin/route del default
	if [ "$GATEWAYS" ] ; then
	    set - $GATEWAYS ; GATEWAY=$1
	fi
    fi

    if is_true $DHCPC ; then
	start-stop-daemon --start --quiet --exec /usr/sbin/dhcpcd -- $DEVICE
    fi

    if [ "$IPADDR" ] ; then

	# Basic network setup
	BC=${BROADCAST:+broadcast $BROADCAST}
	/sbin/ifconfig $DEVICE up $IPADDR netmask $NETMASK $BC

	if [ "$NETWORK" ] ; then
	    /sbin/ifuser $DEVICE $NETWORK || \
		/sbin/route add -net $NETWORK netmask $NETMASK dev $DEVICE
	elif [ "$GATEWAY" ] ; then
	    /sbin/ifuser $DEVICE $GATEWAY || \
		/sbin/route add $GATEWAY $DEVICE
	fi

	test "$GATEWAY" && /sbin/route add default gw $GATEWAY metric 1

	# Update DNS stuff
	if [ "$DOMAIN$SEARCH$DNSSRVS$DNS_1$DNS_2$DNS_3" ] ; then
	    echo "# $DEVICE begin" > $RESOLV.N
	    test "$DOMAIN" && echo "domain $DOMAIN" >> $RESOLV.N
	    test "$SEARCH" && echo "search $SEARCH" >> $RESOLV.N
	    for DNS in ${DNSSRVS:-$DNS_1 $DNS_2 $DNS_3} ; do
		echo "nameserver $DNS" >> $RESOLV.N
	    done
	    echo "# $DEVICE end" >> $RESOLV.N
	    cat $RESOLV >> $RESOLV.N
	    mv $RESOLV.N $RESOLV
	fi

	# Handle NFS mounts
	if [ "$MOUNTS" ] ; then
	    for MT in $MOUNTS ; do mount -v $MT ; done
	fi

    fi

    if [ "$IPX_NETNUM" ] ; then
	ipx_interface add $DEVICE $IPX_FRAME $IPX_NETNUM
    fi

    start_fn $DEVICE
    ;;

'stop')

    stop_fn $DEVICE
    
    if is_true $BOOTP || is_true $DHCPC || [ "$IPADDR" ] ; then

	# Shut down all NFS mounts on this interface
	nfsstop ()
	{
	    while read HOST MT ; do
		if /sbin/ifuser $DEVICE $HOST ; then
		    fuser -s -k -m $MT
		    umount -v $MT
		fi
	    done
	}
	mount -t nfs | sed -e 's/:.* on \(.*\) type .*/ \1/' | nfsstop

	test "$IPX_NETNUM" && ipx_interface del $DEVICE $IPX_FRAME

	# Remove nameservers
	if fgrep -q "# $DEVICE begin" $RESOLV ; then
	    sed -e "/# $DEVICE begin/,/# $DEVICE end/d"	\
		< $RESOLV > $RESOLV.N
	    mv $RESOLV.N $RESOLV
	fi

    fi

    if is_true $DHCPC ; then
	start-stop-daemon --stop --quiet --exec /usr/sbin/dhcpcd
    fi

    /sbin/ifconfig $DEVICE down
    ;;

'check')
    /sbin/ifconfig $DEVICE | grep -q RUNNING || exit 0

    # Check for any in-use NFS mounts
    nfscheck ()
    {
	while read HOST MT ; do
	    /sbin/ifuser $DEVICE $HOST && fuser -sm $MT && exit 1
	done
    }
    mount -t nfs | sed -e 's/:.* on \(.*\) type .*/ \1/' | nfscheck

    # Check for active TCP or UDP connections
    getdests ()
    {
    	IFS=" :" ; read A ; read A
	while read A B C D E HOST PORT STATE ; do
	    if [ "$STATE" != "FIN_WAIT1" -a "$STATE" != "FIN_WAIT2" \
		-a "$STATE" != "CLOSE_WAIT" -a "$STATE" != "TIME_WAIT" \
		-a "$HOST" != "127.0.0.1" -a "$HOST" != "0.0.0.0" \
		-a "$PORT" != "*" ] ; then
		echo $HOST
	    fi
	done
    }
    DESTS=`netstat -ntuw | getdests`
    /sbin/ifuser $DEVICE $DESTS && exit 1
    ;;

'cksum')
    chk_simple "$3,$SOCKET,$INSTANCE,$HWADDR" || exit 1
    ;;

'restart')
    test "$IPADDR" && /sbin/ifconfig $DEVICE down up
    ;;

'suspend'|'resume')
    ;;

*)
    usage
    ;;

esac

exit 0
# Network adapter configuration
#
# Automatically generated during the Debian Installation
#
case "$ADDRESS" in
*,*,*,*)
	IF_PORT="auto"
	# Use BOOTP [y/n]
	BOOTP="n"
	IPADDR="10.0.0.5"
	NETMASK="255.255.255.0"
	NETWORK="10.0.0.0"
	BROADCAST="10.0.0.255"
	GATEWAY="10.0.0.25"
	DOMAIN="kirks.net"
	DNS_1="10.0.0.25"
	;;
esac
nls_iso8859_1      1		1 (autoclean)
nls_cp437          1		1 (autoclean)
serial             8		0 (autoclean)
vfat               4		1
ip_masq_ftp        1		0
psaux              1		1
8390               2		0
xirc2ps_cs         3		0
ds                 2	[xirc2ps_cs]	0
pcmcia_core        9	[xirc2ps_cs ds]	0
Module         Pages    Used by

Reply to: