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

14 lines
295 B
Bash

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