Commit 9314298f authored by Franco Fichtner's avatar Franco Fichtner

openvpn: proper style and a TODO for zapping OpenSSL (#42)

parent 65ab157c
#!/bin/sh
if [ "$1" = "tls" ]; then
(/usr/local/bin/php /usr/local/etc/inc/openvpn.tls-verify.php -d "$2" "$3")
exit $?
/usr/local/bin/php /usr/local/etc/inc/openvpn.tls-verify.php -d "$2" "$3"
else
# Single quoting $password breaks getting the value from the variable.
password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's/=/%3D/g')
username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's/=/%3D/g')
# XXX I really don't like going through openssl for this...
password=$(echo -n "${password}" | /usr/local/bin/openssl enc -base64 | sed -e 's/=/%3D/g')
username=$(echo -n "${username}" | /usr/local/bin/openssl enc -base64 | sed -e 's/=/%3D/g')
(/usr/local/bin/php /usr/local/etc/inc/openvpn.auth-user.php "$username" "$password" "$common_name" "$3" "$2" "$4")
exit $?
/usr/local/bin/php /usr/local/etc/inc/openvpn.auth-user.php "$username" "$password" "$common_name" "$3" "$2" "$4"
fi
exit 1
exit $?
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment