/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to network-hooks.d/openvpn

  • Committer: Teddy Hogeborn
  • Date: 2012-01-01 04:02:00 UTC
  • Revision ID: teddy@recompile.se-20120101040200-8wgma707v4gi7hxn
* debian/rules (binary-common): Exclude network-hooks.d from
                                dh_fixperms.
* mandos (DBusObjectWithProperties.Set): Bug fix: handle byte arrays.
* mandos-clients.conf.xml (DESCRIPTION): Add reference to persistent
                                         state.
* mandos-options.xml (restore): Adjust wording slightly.
* mandos.xml (OPTIONS/--no-restore): Refer to "PERSISTENT STATE"
                                     section.
  (PERSISTENT STATE): New section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
set -e
15
15
 
16
 
CONFIG="$MANDOSNETHOOKDIR/openvpn.conf"
 
16
CONFIG="openvpn.conf"
17
17
 
18
18
# Extract the "dev" setting from the config file
19
 
VPNDEVICE="`sed -n -e 's/#.*//' -e 's/^[[:space:]]*dev[[:space:]]\+//p' \"$CONFIG\"`"
 
19
VPNDEVICE=`sed -n -e 's/[[:space:]]#.*//' \
 
20
    -e 's/^[[:space:]]*dev[[:space:]]\+//p' \
 
21
    "$MANDOSNETHOOKDIR/$CONFIG"`
20
22
 
21
23
PIDFILE=/run/openvpn-mandos.pid
22
24
 
34
36
 
35
37
case "$1" in
36
38
    start)
37
 
        "$openvpn" --cd "$MANDOSNETHOOKDIR" --daemon 'openvpn(Mandos)' --writepid "$PIDFILE" --config "$CONFIG"
 
39
        "$openvpn" --cd "$MANDOSNETHOOKDIR" \
 
40
            --daemon 'openvpn(Mandos)' --writepid "$PIDFILE" \
 
41
            --config "$CONFIG"
38
42
        sleep "$DELAY"
39
43
        ;;
40
44
    stop)
41
 
        PID=`cat \"$PIDFILE\"`
 
45
        PID="`cat \"$PIDFILE\"`"
42
46
        if [ "$PID" -gt 0 ]; then
43
47
            kill "$PID"
44
48
        fi