mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
28 lines
828 B
Bash
Executable File
28 lines
828 B
Bash
Executable File
#!/bin/sh
|
|
|
|
#echo $USERNAME : $REASON : $DEVICE
|
|
|
|
case "$REASON" in
|
|
connect)
|
|
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 " && \
|
|
test "${OCSERV_ROUTES4}" = "192.168.1.0/255.255.255.0 192.168.5.0/255.255.255.0 " && \
|
|
echo > connect.ok
|
|
;;
|
|
disconnect)
|
|
if ! test -z "$DEVICE";then
|
|
#ifconfig $DEVICE
|
|
#if test "$?" = "0";then
|
|
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 " && \
|
|
test "${OCSERV_ROUTES4}" = "192.168.1.0/255.255.255.0 192.168.5.0/255.255.255.0 " && \
|
|
echo > disconnect.ok
|
|
#fi
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
exit 0
|