Some extra example hooks
[ext/instance-debootstrap.git] / examples / hooks / hosts
diff --git a/examples/hooks/hosts b/examples/hooks/hosts
new file mode 100755 (executable)
index 0000000..4daf620
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# This is an example script that sets the hostname and hosts file
+
+VMFQDN=$INSTANCE_NAME
+VMHOSTNAME=${VMFQDN%%.*}
+
+[ x$VMFQDN -eq x$VMHOSTNAME ] && VMFQDN=""
+
+echo "127.0.1.1                $VMFQDN $VMHOSTNAME" >> $TARGET/etc/host
+