From: Serge van Ginderachter Date: Fri, 24 Sep 2010 07:45:06 +0000 (+0200) Subject: Some extra example hooks X-Git-Tag: v0.10~6 X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=commitdiff_plain;h=be6f4049d0f3aa78a31ffefdd91b7a8f7014b7c2 Some extra example hooks 1) Hook to set default passwords in the instance 2) Hook to set a timezone for the instance Signed-off-by: Guido Trotter Reviewed-by: Guido Trotter Reviewed-by: Iustin Pop --- 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..ed1dbd6 --- /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 + +