git://git.onelab.eu
/
plcrt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
98f75cf
)
try to add the reverse-lookup hostname as well to make the rtdemo work
author
Stephen Soltesz
<soltesz@cs.princeton.edu>
Tue, 22 Sep 2009 02:58:53 +0000
(
02:58
+0000)
committer
Stephen Soltesz
<soltesz@cs.princeton.edu>
Tue, 22 Sep 2009 02:58:53 +0000
(
02:58
+0000)
out-of-the-box.
plcrt.init
patch
|
blob
|
history
diff --git
a/plcrt.init
b/plcrt.init
index
bd66b59
..
bd6db4c
100644
(file)
--- a/
plcrt.init
+++ b/
plcrt.init
@@
-17,6
+17,12
@@
local_config=/etc/planetlab/configs/site.xml
PLCRTPATH=/usr/share/plcrt
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
# 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
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
fi
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart