mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
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:
committed by
Nikos Mavrogiannopoulos
parent
9a41a27b18
commit
780fbb89a0
@@ -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 " && \
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user