+# On XenServer 5.5.0, we need refresh-network-uuids to run whenever
+# XAPI starts or restarts. (On XenServer 5.6.0, XAPI calls the
+# "update" method of the vswitch-cfg-update plugin whenever it starts
+# or restarts, so this is no longer necessary.)
+if test "$PRODUCT_VERSION" = "5.5.0"; then
+ RNU=/usr/share/openvswitch/scripts/refresh-network-uuids
+ XSS=/opt/xensource/libexec/xapi-startup-script
+ if test -e $XSS && (test ! -L $XSS || test "`readlink $XSS`" != $RNU); then
+ echo "$XSS is already in use, refusing to overwrite"
+ exit 1
+ fi
+ rm -f $XSS
+ ln -s $RNU $XSS
+
+ # If /etc/xensource/network.conf doesn't exist (it was added in 5.6.0),
+ # then interface-reconfigure will be unhappy when we run it below.
+ if test ! -e /etc/xensource/network.conf; then
+ echo bridge > /etc/xensource/network.conf
+ fi
+fi
+
+