Commit c8ebadfd785f80943ba2b1b8a87b4e926d4918dd

Authored by Frederik Lindenaar
1 parent 8b481a2f

made the check on the result from PrivacyIDEA less sensitive for whitespaces bei…

…ng added / removed as this broke the script in PrivacyIDEA 2.1x.
README.md
@@ -4,12 +4,12 @@ privacyidea-checkotp @@ -4,12 +4,12 @@ privacyidea-checkotp
4 Shell script implementing the [PrivacyIDEA](http://www.privacyidea.org) OTP (One 4 Shell script implementing the [PrivacyIDEA](http://www.privacyidea.org) OTP (One
5 Time Password) check to integrate with [FreeRadius](http://www.freeradius.org) 5 Time Password) check to integrate with [FreeRadius](http://www.freeradius.org)
6 in environments where the FreeRadius Perl plugin is not available to use the 6 in environments where the FreeRadius Perl plugin is not available to use the
7 -standard check script (e.g. on OS X 10.9). 7 +standard check script (e.g. on OS X).
8 8
9 -**Version 1.0**, latest version, documentation and bugtracker available on my 9 +**Version 1.0a**, latest version, documentation and bugtracker available on my
10 [GitLab instance](https://gitlab.lindenaar.net/scripts/privacyidea-checkotp) 10 [GitLab instance](https://gitlab.lindenaar.net/scripts/privacyidea-checkotp)
11 11
12 -Copyright (c) 2015 Frederik Lindenaar. free for distribution under the GNU 12 +Copyright (c) 2015 - 2016 Frederik Lindenaar. free for distribution under the GNU
13 License, see [below](#license) 13 License, see [below](#license)
14 14
15 15
privacyidea-checkotp 100755 → 100644
@@ -49,7 +49,7 @@ fi @@ -49,7 +49,7 @@ fi
49 otpresult=`/usr/bin/curl -s "$URL" --data-urlencode "user=$LOGIN" --data-urlencode "pass=$PASSWORD" --data-urlencode "client=$NAS"` 49 otpresult=`/usr/bin/curl -s "$URL" --data-urlencode "user=$LOGIN" --data-urlencode "pass=$PASSWORD" --data-urlencode "client=$NAS"`
50 50
51 # Extract the status of the request from the returned JSON 51 # Extract the status of the request from the returned JSON
52 -otpstatus=`echo $otpresult | sed 's/^{.*"result": { "status": true, "value": \(.*\) },.*}/\1/'` 52 +otpstatus=`echo $otpresult | sed 's/^{.*"result": *{ *"status": *true, *"value": *\(.*\) *},.*}/\1/'`
53 53
54 if [ "$otpstatus" = "true" ]; then 54 if [ "$otpstatus" = "true" ]; then
55 # echo $LOGIN did authenticate $otpresult 55 # echo $LOGIN did authenticate $otpresult