mirror of https://github.com/apache/cloudstack.git
19 lines
473 B
Bash
Executable File
19 lines
473 B
Bash
Executable File
#!/bin/bash
|
|
|
|
. /etc/default/cloud-passwd-srvr
|
|
guestIp=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
|
|
|
|
while [ "$ENABLED" == "1" ]
|
|
do
|
|
socat -lf /var/log/cloud.log TCP4-LISTEN:8080,reuseaddr,crnl,bind=$guestIp SYSTEM:"/opt/cloud/bin/serve_password.sh \"\$SOCAT_PEERADDR\""
|
|
|
|
rc=$?
|
|
if [ $rc -ne 0 ]
|
|
then
|
|
logger -t cloud "Password server failed with error code $rc. Restarting socat..."
|
|
sleep 3
|
|
fi
|
|
. /etc/default/cloud-passwd-srvr
|
|
|
|
done
|