Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: nero4
Fetching contributors…

Cannot retrieve contributors at this time

file 61 lines (52 sloc) 1.333 kb
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#!/bin/bash
#
# Bring up XenServer management interface
#
# chkconfig: 2345 13 76
# description: Bring up XenServer management interface

. /etc/init.d/functions

export XENSOURCE_INVENTORY=@INVENTORY@
export INTERFACE_RECONFIGURE="@LIBEXECDIR@/interface-reconfigure"

[ -r ${XENSOURCE_INVENTORY} ] || exit 0
. ${XENSOURCE_INVENTORY}

bring_up_mgmt_if() {
    [ -n "${MANAGEMENT_INTERFACE}" ] || return 0
    action $"Bringing up management interface ${MANAGEMENT_INTERFACE}: " \
${INTERFACE_RECONFIGURE} --management --force-interface ${MANAGEMENT_INTERFACE} up
    touch /var/lock/subsys/management-interface
}

bring_up_current_ifs(){
    [ -n "${CURRENT_INTERFACES}" ] || return 0
    for INTF in ${CURRENT_INTERFACES}; do
        [ ${INTF} != "${MANAGEMENT_INTERFACE}" ] || continue
action $"Bringing up additional interface ${INTF}: " \
${INTERFACE_RECONFIGURE} --force-interface ${INTF} up
    done
}

start() {
    bring_up_mgmt_if
    bring_up_current_ifs
}

stop() {
    rm -f /var/lock/subsys/management-interface
    action $"Storing network configuration: " \
${INTERFACE_RECONFIGURE} rewrite
}

restart() {
    stop
    start
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    *)
        echo "Unknown action '$1'."
        ;;
esac
Something went wrong with that request. Please try again.