source: projects/initscripts/tags/initscripts-8.91.0/sysconfig/network-scripts/ifup-sl @ 2576

Revision 2576, 1.6 KB checked in by daisuke, 13 years ago (diff)

tagging as initscripts-8.91.0

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