You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
670 B

# is a client-connect script for OpenVPN server
# It allow clients to connect only if their CN is in $AUTH_FILE
# You need this parameters in your's server config :
# script-security 3
# client-connect <path-to-cn-filter>/
set -u
grep -qE "^${common_name}$" "${AUTH_FILE}"
if [ "$?" -eq 0 ]; then
logger -i -t openvpn-cn-filter -p "Accepted login for ${common_name} from ${trusted_ip} port ${trusted_port}"
exit 0
logger -i -t openvpn-cn-filter -p auth.notice "Failed login for ${common_name} from ${trusted_ip} port ${trusted_port}"
exit 1