---
 examples/hooks/confdata/defaultpasswords |    1 +
 examples/hooks/confdata/timezone         |    1 +
 examples/hooks/defaultpasswords          |    7 +++++++
 examples/hooks/hosts                     |   11 +++++++++++
 examples/hooks/timezone                  |    8 ++++++++
 5 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 examples/hooks/confdata/defaultpasswords
 create mode 100644 examples/hooks/confdata/timezone
 create mode 100755 examples/hooks/defaultpasswords
 create mode 100755 examples/hooks/hosts
 create mode 100755 examples/hooks/timezone

diff --git a/examples/hooks/confdata/defaultpasswords
b/examples/hooks/confdata/defaultpasswords
new file mode 100644
index 0000000..548683d
--- /dev/null
+++ b/examples/hooks/confdata/defaultpasswords
@@ -0,0 +1 @@
+root:s3cr3t
diff --git a/examples/hooks/confdata/timezone b/examples/hooks/confdata/timezone
new file mode 100644
index 0000000..82f7e44
--- /dev/null
+++ b/examples/hooks/confdata/timezone
@@ -0,0 +1 @@
+Europe/Brussels
diff --git a/examples/hooks/defaultpasswords b/examples/hooks/defaultpasswords
new file mode 100755
index 0000000..b2296ce
--- /dev/null
+++ b/examples/hooks/defaultpasswords
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# This is an example script that sets the root pasword to a given default
+
+cat $(dirname $0)/confdata/defaultpasswords | chroot $TARGET chpasswd
+
+
diff --git a/examples/hooks/hosts b/examples/hooks/hosts
new file mode 100755
index 0000000..4daf620
--- /dev/null
+++ b/examples/hooks/hosts
@@ -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
+
diff --git a/examples/hooks/timezone b/examples/hooks/timezone
new file mode 100755
index 0000000..ff6c968
--- /dev/null
+++ b/examples/hooks/timezone
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# This is an example script that sets the timezone to a given default
+
+cp confdata/timezone $TARGET/etc/
+chroot $TARGET dpkg-reconfigure --frontend noninteractive tzdata
+
+
-- 
1.7.0.4

Reply via email to