#!/bin/bash
+# vim: sw=2 ts=2 sts=2 et :
+
+if [ -f /.autorelabel ]; then
+ echo "**********************************************"
+ echo "* SYSTEM REQUIRES RELABELING SKIPPING RESEAL *"
+ echo "* PLEASE RESTART SYSTEM AND RERUN *"
+ echo "* PROVISIONING SCRIPTS *"
+ echo "**********************************************"
+ exit 1;
+fi
+
# clean-up from any prior cloud-init networking
rm -rf /etc/sysconfig/network-scripts/{ifcfg,route}-eth*
rm -rf ~/.viminfo /etc/ssh/ssh*key*
+# kill any cloud-init related bits
+rm -rf /var/lib/cloud/*
+
+if [ -e /usr/bin/facter ]
+then
+ if [ `/usr/bin/facter operatingsystem` = 'Ubuntu' ]
+ then
+ rm -rf /etc/hostname* /etc/hosts /etc/network/interfaces /etc/network/interfaces.*.bak~
+ cat <<EOINT >> /etc/network/interfaces
+# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
+# /usr/share/doc/ifupdown/examples for more information.
+# The loopback network interface
+auto lo
+iface lo inet loopback
+EOINT
+ fi
+fi
+
echo "********************************************"
echo "* PLEASE SNAPSHOT IMAGE AT THIS TIME *"
echo "********************************************"