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