3 # $Id: ifup-sl,v 1.7 1999/07/13 12:49:37 misiek Exp $
5 PATH=/sbin:/usr/sbin:/bin:/usr/bin
7 # ifup-post can't be done for slip :-( Solution: use PPP
9 # become a daemon in case we have to persist.
10 if [ "$1" != daemon ] ; then
11 # disconnect stdin, out, err to disassociate from controlling tty
12 # so that no HUPs will get through.
13 $0 daemon $*& </dev/null >/dev/null 2>/dev/null
18 cd /etc/sysconfig/network-scripts
19 . /etc/rc.d/init.d/functions.network
24 if [ "foo$2" = "fooboot" -a ${ONBOOT} = "no" ]
29 if [ -z "$RETRYTIMEOUT" ]; then
33 # we can use dip or direct slip connection via slattach
34 if [ "$DIRECT_CONNECT" != "yes" ]; then
36 [ -x /usr/sbin/dip ] || {
37 echo "/usr/sbin/dip does not exist or is not executable"
38 echo "ifup-sl for $DEVICE exiting"
39 logger -p daemon.info -t ifup-sl \
40 "/usr/sbin/dip does not exist or is not executable for $DEVICE"
44 DIPSCRIPT=/etc/sysconfig/network-scripts/dip-$DEVNAME
45 [ -f $DIPSCRIPT ] || {
46 DIPSCRIPT=/etc/sysconfig/network-scripts/dip-$PARENTDEVNAME
48 [ -f $DIPSCRIPT ] || {
49 echo "/etc/sysconfig/network-scripts/dip-$DEVICE does not exist"
50 echo "ifup-sl for $DEVICE exiting"
51 logger -p daemon.info -t ifup-sl \
52 "/etc/sysconfig/network-scripts/dip-$DEVICE does not exist for $DEVICE"
57 echo > /var/run/sl-$DEVICE.dev
58 (logger -p daemon.info -t ifup-sl \
59 "dip started for $DEVICE on $MODEMPORT at $LINESPEED" &)&
60 doexec /usr/sbin/dip dip-$DEVICE $DIPSCRIPT
61 if [ "$PERSIST" != "yes" -o ! -f /var/run/sl-$DEVICE.dev ] ; then
64 rm -f /var/run/sl-$DEVICE.dev
67 sleep $RETRYTIMEOUT || {
74 # direct connection via slattach
75 [ -z "$MTU" ] && MTU=1500
76 [ -z "$PROTOCOL" ] && PROTOCOL=slip
78 [ -x /sbin/slattach ] || {
79 echo "/sbin/slattach does not exist or is not executable"
80 echo "ifup-sl for $DEVICE exiting"
81 logger -p daemon.info -t ifup-sl \
82 "/sbin/slattach does not exist or is not executable for $DEVICE"
86 echo > /var/run/sl-$DEVICE.dev
87 (logger -p daemon.info -t ifup-sl \
88 "slattach started for $DEVICE on $MODEMPORT at $LINESPEED" &)&
90 # Check if slattach (or other process) is using $MODEMPORT
91 # if not - execute slattach
92 if [ -x /usr/sbin/fuser ] && fuser -s $MODEMPORT; then
93 logger -p daemon.info -t ifup-sl "some process is currently using $MODEMPORT"
94 echo "some process is currently using $MODEMPORT - aborting..."
96 slattach -p $PROTOCOL -s $LINESPEED $MODEMPORT &
98 ip link set $DEVICE mtu $MTU up
99 ip addr add $IPADDR peer $REMIP dev $DEVICE
100 # routing chyba jest ustawiany przez g³ówny skrypt ifup ...
101 # if [ "$DEFROUTE" = yes ] ; then
102 # route del $REMIP > /dev/null 2>&1
103 # ip route add 0.0.0.0/0 dev $DEVICE