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

executable file 44 lines (40 sloc) 1.03 kb
#!/bin/sh
#
# Copyright (c) Citrix Systems 2008. All rights reserved.
#
# Usage: ssh root@<host> @LIBEXECDIR@/interface-visualise > <host>-network.dot
# dotty <host>-network.dot
echo "digraph G {"
for i in ${1:-/etc/sysconfig/network-scripts}/ifcfg-* ; do
case $i in
*.xapi-new) continue ;;
*.xapi-old) continue ;;
*) ;;
esac
echo "$i" 1>&2
(
source "$i"
if [ X"${XEMANAGED}" = "Xyes" ] ; then
XEMANAGED="\nXE"
fi
if [ -n "${BOOTPROTO}" ] ; then
echo "\"${DEVICE}\" [label=\"\N\n(${BOOTPROTO})${XEMANAGED}\"]"
else
echo "\"${DEVICE}\" [label=\"\N${XEMANAGED}\"]"
fi
if [ -n "${BRIDGE}" ] ; then
echo "\"${BRIDGE}\" -> \"${DEVICE}\""
fi
if [ -n "${MASTER}" ] ; then
echo "\"${MASTER}\" -> \"${DEVICE}\""
fi
if [ "${VLAN}"X = "yesX" ] && [ -z "${PHYSDEV}" ] ; then
PHYSDEV=${DEVICE%.*}
#PHYSDEV=$(echo ${DEVICE} | LC_ALL=C sed 's/^[a-z0-9]*\.0*//')
fi
if [ -n "${PHYSDEV}" ] ; then
echo "\"${DEVICE}\" -> \"${PHYSDEV}\""
fi
)
done
echo "}"
Jump to Line
Something went wrong with that request. Please try again.