Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (52 sloc) 1.333 kb
#!/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
Jump to Line
Something went wrong with that request. Please try again.