summaryrefslogtreecommitdiff
blob: 101ba801c2ca3c9d1d2609e9e63ee74c850604e6 (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
#!/bin/sh
# Copyright (c) 2012 Alexandre Rostovtsev
# Released under the 2-clause BSD license.

# Ensures that the nm-interfaces OpenRC service is marked as started if
# NetworkManager had been started via openrc and brought up some interfaces.

# Exit if no valid interface name given
if [ -z "$1" -o "x$1" = "xnone" ]; then
    exit 1
fi

# Exit if the NetworkManager OpenRC service is not running
"@EPREFIX@/etc/init.d/NetworkManager" status &> /dev/null || exit 1

case "$2" in
    up)
        exec "@EPREFIX@/etc/init.d/nm-interfaces" mark-started
        ;;
    down)
        exec "@EPREFIX/etc/init.d/nm-interfaces" stop
        ;;
esac

exit 1