3 # radtest Emulate the user interface of the old
4 # radtest that used to be part of FreeRADIUS.
10 exec_prefix="@exec_prefix@"
14 echo "Usage: radtest [OPTIONS] user passwd radius-server[:port] nas-port-number secret [ppphint] [nasname]" >&2
15 echo " -d RADIUS_DIR Set radius directory" >&2
16 echo " -t pap/chap/mschap Set authentication method" >&2
17 echo " -x Enable debug output" >&2
21 radclient=$bindir/radclient
22 if [ ! -x "$radclient" ] && [ -x ./radclient ]
28 PASSWORD="User-Password"
30 # We need at LEAST these many options
31 if [ $# -lt 5 ] || [ $# -gt 7 ]
36 # Parse new command-line options
37 while [ `echo "$1" | cut -c 1` = "-" ]
41 OPTIONS="$OPTIONS -d $2"
53 PASSWORD="User-Password"
56 PASSWORD="CHAP-Password"
59 PASSWORD="MS-CHAP-Password"
74 # Check that there are enough options left over.
75 if [ $# -lt 5 ] || [ $# -gt 7 ]
88 echo "User-Name = \"$1\""
89 echo "$PASSWORD = \"$2\""
90 echo "NAS-IP-Address = $nas"
94 echo "Framed-Protocol = PPP"
96 ) | $radclient $OPTIONS -x $3 auth $5