]> git.pld-linux.org Git - projects/rc-scripts.git/blame - sysconfig/network-scripts/ifup-sl
Synced with latest from old repo
[projects/rc-scripts.git] / sysconfig / network-scripts / ifup-sl
CommitLineData
12de71be 1#!/bin/sh
7742e157
AF
2PATH=/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.
7if [ "$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
12fi
13shift
14
12de71be 15cd /etc/sysconfig/network-scripts
7e04fe0e 16. /etc/rc.d/init.d/functions.network
12de71be 17
18CONFIG=$1
7742e157
AF
19source_config
20
21if [ "foo$2" = "fooboot" -a ${ONBOOT} = "no" ]
22then
23 exit
24fi
25
26if [ -z "$RETRYTIMEOUT" ]; then
27 RETRYTIMEOUT=30
28fi
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
38DIPSCRIPT=/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
50while : ; 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 }
65done
66
This page took 0.221849 seconds and 4 git commands to generate.