#!/bin/bash MAIN_TPL="/usr/share/lliurex/angel-tools/main.cf" _die(){ echo "$@" && exit 1 } echo "Esta es la primera vez que ejecuta esta utilidad o" echo "tambien es posible que quiera volver a ejecutar esto" echo "por voluntad propia (hagaselo mirar)" sleep 1 echo "Vamos a pasar unos instantes configurando postfix" HOSTCOMPLETE=$(host $(lliurex-net get_current_ip $(lliurex-net get_first_nic)) | sed "s%.*[[:blank:]]\(.*\)\.$%\1%") || _die "No network card information available, use " HOSTREDUCED=$(echo $HOSTCOMPLETE | cut -d "." -f1 ) || die "HostReduced Name not be present" export HOSTCOMPLETE=$HOSTCOMPLETE || die "Error in values" export HOSTREDUCED=$HOSTREDUCED || die "Error in values" #TODO Use DEBCONF cat $MAIN_TPL | llxcfg-template - > /etc/postfix/main.cf echo "### Configured By Angel-Tools" >> /etc/postfix/main.cf unset HOSTCOMPLETE HOSTREDUCED echo "Todo ha ido bien...."