~ubuntu-branches/ubuntu/karmic/ifscheme/karmic

« back to all changes in this revision

Viewing changes to debian/ifscheme.init

  • Committer: Bazaar Package Importer
  • Author(s): Guus Sliepen
  • Date: 2006-12-09 16:03:01 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209160301-fgy972pqgj5e3s28
Tags: 1.7-1
* New upstream release.
* Fix spelling mistake in package description. Closes: #363954
* Apply patch from Stefan Ott that adds bash completion. Closes: #387294
* debhelper is a Build-Depends, not a Build-Depends-Indep.
* Add LSB section to the init file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
NAME=ifscheme
4
 
SCHEMEVOLATILE=/etc/network/run/scheme
5
 
SCHEMEPERSISTENT=/var/lib/ifscheme/scheme
6
 
 
7
 
if [ -f /etc/default/ifscheme ]; then
8
 
        . /etc/default/ifscheme
9
 
fi
10
 
 
11
 
do_start() {
12
 
        if [ -n "$BOOT_SCHEME" ]; then
13
 
                ifscheme "$BOOT_SCHEME"
14
 
        else
15
 
                if [ -r $SCHEMEPERSISTENT ]; then
16
 
                        read scheme < $SCHEMEPERSISTENT
17
 
                        ifscheme "$scheme"
18
 
                fi
19
 
        fi
20
 
}
21
 
 
22
 
do_stop() {
23
 
        if [ -r $SCHEMEVOLATILE ]; then
24
 
                cat $SCHEMEVOLATILE > $SCHEMEPERSISTENT
25
 
        else
26
 
                rm -f $SCHEMEPERSISTENT
27
 
        fi
28
 
}
29
 
 
30
 
case "$1" in
31
 
        start)
32
 
                do_start
33
 
        ;;
34
 
        reload|force-reload|restart)
35
 
                do_stop
36
 
                do_start
37
 
        ;;
38
 
        stop)
39
 
                do_stop
40
 
        ;;
41
 
        *)
42
 
                echo "Usage: invoke-rc.d $NAME {start|stop|reload|force-reload|restart}"
43
 
        ;;
44
 
esac
45
 
 
46
 
exit 0