summaryrefslogtreecommitdiffstats
path: root/contrib/11netcfg
blob: db65f5a5509026f6c62dbfa10face88b95a52d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash

source /usr/lib/pm-utils/functions
source /etc/pm/config.d/netcfg

suspend_netcfg() {
    case $NETCFG_SUSPEND in
        daemons)
            stopservice net-profiles
            stopservice net-auto-wired
            stopservice net-auto-wireless
        ;;
        retain|*)
            netcfg all-suspend
        ;;
    esac
}

resume_netcfg() {
    case $NETCFG_SUSPEND in
        daemons)
            restartservice net-profiles
            restartservice net-auto-wired
            restartservice net-auto-wireless
            ;;
        retain|*)
            netcfg all-resume
            ;;
    esac
}

if [ -x /usr/bin/netcfg2 ]; then
    case "$1" in
        hibernate|suspend)
            suspend_netcfg
            ;;
        thaw|resume)
            resume_netcfg
            ;;
        *)
            ;;
    esac
fi

exit $?

# vim: ft=sh ts=4 et sw=4: