1
0
Fork 0
mirror of synced 2024-11-22 09:05:34 -05:00
openvpn-user/auth_totp.sh

15 lines
295 B
Bash
Raw Permalink Normal View History

#!/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