#!/bin/sh set -eu readWriteIP="127.0.0.2" readIP="127.0.0.3" # nginx will default to this bind address. If we get an incoming connection with # this address something has gone wrong and we should reject unexpectedIP="127.0.0.1" if [ "$RFB_CLIENT_IP" = "${readWriteIP}" ]; then exit 0 elif [ "$RFB_CLIENT_IP" = "${readIP}" ]; then exit 3 elif [ "$RFB_CLIENT_IP" = "${unexpectedIP}" ]; then exit 1 fi # Any connections using a non-loopback address should exit with 0 to ensure # direct vnc has full access exit 0