echo "$(date --rfc-3339=seconds): Das ist das Post-Install-Script '$0'."
echo
+if [[ -z "${hostname}" ]] ; then
+ hostname="template.pixelpark.com"
+fi
+IP_ADDRESS_ETH0=$( host "${hostname}" | sed -e 's/.*has address[ ][ ]*//' )
+DOMAIN=$( echo "${hostname}" | cut -d. -f2,3 )
+SIMPLE_HOSTNAME=$( echo "${hostname}" | cut -d. -f1 )
echo
echo "Some information:"
echo " \$hostname: $hostname"
-echo " \$ip_address_ether0: $ip_address_ether0"
echo " \$system_name: $system_name"
+echo " \$IP_ADDRESS_ETH0: $IP_ADDRESS_ETH0"
+echo " \$SIMPLE_HOSTNAME: $SIMPLE_HOSTNAME"
+echo " \$DOMAIN: $DOMAIN"
#-----------------------------------------------------------
log() {
}
+#-----------------------------------------------------------
+create_etc_hosts() {
+
+ log "Generating /etc/hosts ..."
+
+ cat <<-EOF >/etc/hosts
+ # generated by pixelpark install server
+
+ 127.0.0.1 localhost
+ ${IP_ADDRESS_ETH0} ${hostname} ${SIMPLE_HOSTNAME}
+
+ EOF
+
+}
+
#-----------------------------------------------------------
main() {
create_authkeys
import_ssh_hostkeys
+ create_etc_hosts
}
#-----------------------------------------------------------
main "$@"
-# vim: ts=4 et
+# vim: ts=4 et list