-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f75c805
commit 2c627aa
Showing
4 changed files
with
84 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,65 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Start SSH server | ||
mkdir -p /var/run/sshd | ||
|
||
# Start supervisord | ||
/usr/bin/supervisord -c /root/supervisord.conf | ||
|
||
# Info | ||
echo "winvnc running at http://0.0.0.0:$HTTP_PORT/vnc.html?password=$VNC_PASSWORD" | ||
echo "winvnc running at https://0.0.0.0:$HTTPS_PORT/vnc.html?password=$VNC_PASSWORD" | ||
for i in {1..10}; do | ||
if [ $i -eq 10 ]; then | ||
cat /var/log/sshd.err | ||
exit 1 | ||
fi | ||
|
||
if netstat -tulpn | grep :40022; then | ||
break | ||
fi | ||
|
||
sleep 1 | ||
done | ||
|
||
for i in {1..10}; do | ||
if [ $i -eq 10 ]; then | ||
cat /var/log/x11vnc.err | ||
cat /var/log/reverse_ssh.err | ||
exit 1 | ||
fi | ||
|
||
if netstat -tulpn | grep :45900; then | ||
break | ||
fi | ||
|
||
sleep 1 | ||
done | ||
|
||
for i in {1..10}; do | ||
if [ $i -eq 10 ]; then | ||
cat /var/log/novnc_http.err | ||
exit 1 | ||
fi | ||
|
||
if netstat -tulpn | grep :$HTTP_PORT; then | ||
echo "winvnc is available at http://$HOSTNAME:$HTTP_PORT/vnc.html?password=$VNC_PASSWORD" | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
|
||
for i in {1..10}; do | ||
if [ $i -eq 10 ]; then | ||
cat /var/log/novnc_https.err | ||
exit 1 | ||
fi | ||
|
||
if netstat -tulpn | grep :$HTTPS_PORT; then | ||
echo "winvnc is available at https://$HOSTNAME:$HTTPS_PORT/vnc.html?password=$VNC_PASSWORD" | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
|
||
# Sleep forever | ||
while true; do sleep 1000; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters