#!/bin/sh
#
#
# This file is part of the IPCop Firewall.
#
# IPCop is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# IPCop is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with IPCop; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
#
# Copyright (C) 2009, the IPCop team.
#
# $Id: openvpnverify 3016 2009-06-11 11:04:56Z owes $

if [ $1 -eq 0 ]; then
    name2=`echo $2`
    name3=${name2##*/}
    name4=${name3##*CN=}
    name5=`echo $name4 | sed 's/[_]/ /g'`
    clientdisabled=`/bin/grep -iwc "off,.*,$name5" /var/ipcop/openvpn/config`
    if [ "$clientdisabled" = "1" ]; then
        exit 1
    fi

    exit 0
fi
exit 0
				    
