summaryrefslogtreecommitdiffstats
path: root/util-vserver-vars
blob: 416d83eddb7bc31ebb083e9762e2d78d73b7e83e (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
: ${REAL_UTIL_VSERVER_VARS:=/usr/lib/x86_64-linux-gnu/util-vserver/util-vserver-vars}
test -e "$REAL_UTIL_VSERVER_VARS" || {
    echo $"Can not find util-vserver installation (the file '$REAL_UTIL_VSERVER_VARS' would be expected); aborting..." >&2
    exit 1
}
. "$REAL_UTIL_VSERVER_VARS"

# save defaults
_REAL_LIB_VSERVER_FUNCTIONS="${_LIB_VSERVER_FUNCTIONS}"
_REAL_VSERVER="${_VSERVER}"
_REAL_VSHELPER="${_VSHELPER}"

case "$0" in
    /usr/sbin/vserver*)
        # we want to wrap a function from vserver.functions
        # so we want to wrap vserver.functions that will be include with:
        # . ${_LIB_VSERVER_FUNCTIONS}
        _LIB_VSERVER_FUNCTIONS="$__PKGDATADIR/netns/vserver.functions"
        ;;

    *)
        # overwrite _VSERVER for wrapper script
        _VSERVER="/usr/sbin/vserver.netns"
        ;;
esac

# overwrite _VSHELPER for init script
_VSHELPER="$__PKGLIBEXECDIR/vshelper.netns"