1
0
Fork 0
mirror of synced 2024-11-22 00:55:34 -05:00
openvpn-user/auth.sh
2022-11-18 15:47:42 +03:00

14 lines
No EOL
300 B
Bash

#!/usr/bin/env sh
PATH=$PATH:/usr/local/bin
set -e
auth_usr=$(head -1 $1)
auth_passwd=$(tail -1 $1)
if [ $common_name = ${auth_usr} ]; then
openvpn-user auth --user ${auth_usr} --password ${auth_passwd} # --db.path /etc/openvpn/easyrsa/pki/users.db
else
echo "Authorization failed"
exit 1
fi