]> git.pld-linux.org Git - projects/rc-scripts.git/blob - sysconfig/network-scripts/ifup-sl
Synced with latest from old repo
[projects/rc-scripts.git] / sysconfig / network-scripts / ifup-sl
1 #!/bin/sh
2 PATH=/sbin:/usr/sbin:/bin:/usr/bin
3
4 # ifup-post can't be done for slip :-( Solution: use PPP
5
6 # become a daemon in case we have to persist.
7 if [ "$1" != daemon ] ; then
8   # disconnect stdin, out, err to disassociate from controlling tty
9   # so that no HUPs will get through.
10   $0 daemon $*& </dev/null >/dev/null 2>/dev/null
11   exit 0
12 fi
13 shift
14
15 cd /etc/sysconfig/network-scripts
16 . /etc/rc.d/init.d/functions.network
17
18 CONFIG=$1
19 source_config
20
21 if [ "foo$2" = "fooboot" -a ${ONBOOT} = "no" ]
22 then
23   exit
24 fi
25
26 if [ -z "$RETRYTIMEOUT" ]; then
27   RETRYTIMEOUT=30
28 fi
29
30 [ -x /usr/sbin/dip ] || {
31   echo "/usr/sbin/dip does not exist or is not executable"
32   echo "ifup-sl for $DEVICE exiting"
33   logger -p daemon.info -t ifup-sl \
34     "/usr/sbin/dip does not exist or is not executable for $DEVICE"
35   exit 1
36 }
37
38 DIPSCRIPT=/etc/sysconfig/network-scripts/dip-$DEVNAME
39 [ -f $DIPSCRIPT ] || {
40   DIPSCRIPT=/etc/sysconfig/network-scripts/dip-$PARENTDEVNAME
41 }
42 [ -f $DIPSCRIPT ] || {
43   echo "/etc/sysconfig/network-scripts/dip-$DEVICE does not exist"
44   echo "ifup-sl for $DEVICE exiting"
45   logger -p daemon.info -t ifup-sl \
46     "/etc/sysconfig/network-scripts/dip-$DEVICE does not exist for $DEVICE"
47   exit 1
48 }
49
50 while : ; do
51   echo > /var/run/sl-$DEVICE.dev
52   (logger -p daemon.info -t ifup-sl \
53     "dip started for $DEVICE on $MODEMPORT at $LINESPEED" &)&
54   doexec /usr/sbin/dip dip-$DEVICE $DIPSCRIPT
55   if [ "$PERSIST" != "yes" -o ! -f /var/run/sl-$DEVICE.dev ] ; then
56     exit 0
57   fi
58   rm -f /var/run/sl-$DEVICE.dev
59
60
61   sleep $RETRYTIMEOUT || {
62     # sleep was killed
63     exit 0
64   }
65 done
66
This page took 0.080299 seconds and 3 git commands to generate.