This is supposed to call a php script on a remote server using Curl. The curl command works if you plug in values instead of variables, so I know the syntax is off here.
However, the odd part to me is that the result is always successful when it greps the variable. Any ideas? Thanks in advance!
#!/bin/bash
# this script should call the curl command to run the php script
# on the web server and log the user in openvpn client
echo Enter Account Number:
read accountNum
echo Enter Password:
read pwVar
# curl command to run php script on web server
authResult=$(curl -X POST IPADDRESSOFSERVERREMOVED -d '{"accountNumber":"$accountNum","password":"$pwVar"}' -H 'Content-Type: application/json')
authResult2=$(echo "$authResult")
if [ authResult2=$(echo "$authResult" | grep "successfully") ]
then
echo yep it works
else
echo no it dont
fi