cloudstack/patches/systemvm/root/run_domr_webserver
2010-09-09 13:27:20 -07:00

18 lines
359 B
Bash
Executable File

#!/bin/bash
# @VERSION@
guestIp=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
while true
do
/usr/bin/socat TCP4-LISTEN:8080,reuseaddr,crnl,bind=$guestIp SYSTEM:"/root/send_password_to_domu.sh \"\$SOCAT_PEERADDR\""
rc=$?
if [ $rc -ne 0 ]
then
logger "Socat failed with error code $rc. Restarting socat..."
sleep 3
fi
done