2021-02-15 01:03:38 -05:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
PATH=$PATH:/usr/local/bin
|
|
|
|
set -e
|
|
|
|
|
|
|
|
env
|
|
|
|
|
|
|
|
auth_usr=$(head -1 $1)
|
|
|
|
auth_passwd=$(tail -1 $1)
|
|
|
|
|
2022-07-21 11:17:53 -04:00
|
|
|
if [ $common_name = $auth_usr ]; then
|
2021-02-15 01:03:38 -05:00
|
|
|
openvpn-user auth --db.path /etc/openvpn/easyrsa/pki/users.db --user ${auth_usr} --password ${auth_passwd}
|
|
|
|
else
|
|
|
|
echo "Authorization failed"
|
|
|
|
exit 1
|
2022-07-21 11:17:53 -04:00
|
|
|
fi
|