made the check on the result from PrivacyIDEA less sensitive for whitespaces being added / removed as this broke the script in PrivacyIDEA 2.1x.

This commit is contained in:
2016-09-15 10:47:20 +02:00
parent 8b481a2f89
commit c8ebadfd78
2 changed files with 4 additions and 4 deletions

2
privacyidea-checkotp Executable file → Normal file
View File

@@ -49,7 +49,7 @@ fi
otpresult=`/usr/bin/curl -s "$URL" --data-urlencode "user=$LOGIN" --data-urlencode "pass=$PASSWORD" --data-urlencode "client=$NAS"`
# Extract the status of the request from the returned JSON
otpstatus=`echo $otpresult | sed 's/^{.*"result": { "status": true, "value": \(.*\) },.*}/\1/'`
otpstatus=`echo $otpresult | sed 's/^{.*"result": *{ *"status": *true, *"value": *\(.*\) *},.*}/\1/'`
if [ "$otpstatus" = "true" ]; then
# echo $LOGIN did authenticate $otpresult