X-Git-Url: http://git.onelab.eu/?p=plcrt.git;a=blobdiff_plain;f=plcrt.init;fp=plcrt.init;h=bd6db4c2b22be00bbec0c1db37d2dad5f462816e;hp=bd66b59b76cc8298fb10ab9163513f9c9e49d570;hb=61b5180799f032b4e3ba93445a183998d5cf5796;hpb=98f75cf5f1846cb14af601ce32b8b6f5fa31a181 diff --git a/plcrt.init b/plcrt.init index bd66b59..bd6db4c 100644 --- a/plcrt.init +++ b/plcrt.init @@ -17,6 +17,12 @@ local_config=/etc/planetlab/configs/site.xml PLCRTPATH=/usr/share/plcrt +function gethostbyaddr () +{ + python -c 'import socket; import sys; print socket.gethostbyaddr(sys.argv[1])[0]' $1 2>/dev/null +} + + # Be verbose set -x @@ -228,6 +234,11 @@ check_rt_sendmail () if ! grep "$PLC_RT_HOST" /etc/mail/local-host-names ; then # edit /etc/mail/local-host-names echo "$PLC_RT_HOST" >> /etc/mail/local-host-names + IP=$( gethostbyname $PLC_RT_HOST ) + REVHOST=$( gethostbyaddr $IP ) + if [ -n "$REVHOST" ] ; then + echo "$REVHOST" >> /etc/mail/local-host-names + fi fi m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf service sendmail restart