-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpas_auth.sh
executable file
·34 lines (32 loc) · 1.09 KB
/
pas_auth.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
METHOD="$1"
MAC="$2"
./auth_curl auth_client "$2" "$3" "$4"
case "$METHOD" in
auth_client)
if [ "$?" -eq 0 ]; then
# Allow client to access the Internet for one hour (3600 seconds)
# # Further values are upload and download limits in bytes. 0 for no limit.
echo 3600 0 0
exit 0
elif [ "$?" -eq 2 ]; then
echo 1200 0 0
exit 0
else
# Deny client to access the Internet.
exit 1
fi
;;
client_auth|client_deauth|idle_deauth|timeout_deauth|ndsctl_auth|ndsctl_deauth|shutdown_deauth)
INGOING_BYTES="$3"
OUTGOING_BYTES="$4"
SESSION_START="$5"
SESSION_END="$6"
# client_auth: Client authenticated via this script.
# client_deauth: Client deauthenticated by the client via splash page.
# idle_deauth: Client was deauthenticated because of inactivity.
# timeout_deauth: Client was deauthenticated because the session timed out.
# ndsctl_auth: Client was authenticated by the ndsctl tool.
# ndsctl_deauth: Client was deauthenticated by the ndsctl tool.
# shutdown_deauth: Client was deauthenticated by Nodogsplash terminating.
;;
esac