Script needs access to additional client metadata.

Export more information to the script, including client device platform,
type and user agent.

Resolves: #256

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
Alan Jowett
2020-03-02 12:12:43 -07:00
committed by Nikos Mavrogiannopoulos
parent 9a41a27b18
commit 780fbb89a0
13 changed files with 81 additions and 15 deletions

View File

@@ -1,16 +1,27 @@
#!/bin/sh
#!/bin/bash
#echo $USERNAME : $REASON : $DEVICE
env >/tmp/out.$REASON.tmp
if test -z "${IP_REMOTE}";then
echo "Remote IP environment variable was not set"
exit 1
fi
verify_env_set() {
if test -z "${!1}";then
echo "$1 environment variable was not set" > /tmp/out.$REASON.fail.tmp
exit 1
fi
}
verify_env_set "IP_REMOTE"
verify_env_set "REASON"
case "$REASON" in
connect)
verify_env_set "USERNAME"
verify_env_set "USER_AGENT"
verify_env_set "DEVICE"
verify_env_set "DEVICE_PLATFORM"
verify_env_set "DEVICE_TYPE"
test "${OCSERV_DNS}" = "192.168.1.1 192.168.5.1 " && \
test "${OCSERV_DNS4}" = "192.168.1.1 192.168.5.1 " && \
test "${OCSERV_ROUTES}" = "192.168.1.0/255.255.255.0 192.168.5.0/255.255.255.0 " && \

View File

@@ -51,6 +51,8 @@ trap finish EXIT
rm -f ${builddir}/connect.ok
rm -f ${builddir}/disconnect.ok
OPENCONNECT="$OPENCONNECT --os=android"
$OPENCONNECT --help|grep local-hostname >/dev/null
if test $? != 0;then
echo "Openconnect doesn't support --local-hostname"