...
1#!/bin/sh
2
3set -eu
4
5readWriteIP="127.0.0.2"
6readIP="127.0.0.3"
7# nginx will default to this bind address. If we get an incoming connection with
8# this address something has gone wrong and we should reject
9unexpectedIP="127.0.0.1"
10
11if [ "$RFB_CLIENT_IP" = "${readWriteIP}" ]; then
12 exit 0
13elif [ "$RFB_CLIENT_IP" = "${readIP}" ]; then
14 exit 3
15elif [ "$RFB_CLIENT_IP" = "${unexpectedIP}" ]; then
16 exit 1
17fi
18
19# Any connections using a non-loopback address should exit with 0 to ensure
20# direct vnc has full access
21exit 0
View as plain text