diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:46 +0000 |
commit | 50b37d4a27d3295a29afca2286f1a5a086142cec (patch) | |
tree | 9212f763934ee090ef72d823f559f52ce387f268 /src/main/radzap | |
parent | Initial commit. (diff) | |
download | freeradius-50b37d4a27d3295a29afca2286f1a5a086142cec.tar.xz freeradius-50b37d4a27d3295a29afca2286f1a5a086142cec.zip |
Adding upstream version 3.2.1+dfsg.upstream/3.2.1+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/main/radzap')
-rwxr-xr-x | src/main/radzap | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/main/radzap b/src/main/radzap new file mode 100755 index 0000000..f05f253 --- /dev/null +++ b/src/main/radzap @@ -0,0 +1,54 @@ +#!/bin/sh +# +# $Id$ +# + +usage() { + echo "Usage: radzap [options] server[:port] secret" >&2 + echo " -h Print usage help information." + echo " -d raddb_directory: directory where radiusd.conf is located." + echo " -D dict_directory: directory where the dictionaries are located." + echo " -N nas_ip_address: IP address of the NAS to zap." + echo " -P nas_port: NAS port that the user is logged into." + echo " -u username: Name of user to zap (case insensitive)." + echo " -U username: like -u, but case-sensitive." + echo " -x Enable debugging output." + exit ${1:-0} +} + +while test "$#" != "0" +do + case $1 in + -h) usage;; + + -d) OPTS="$OPTS -d $2";shift;shift;; + + -D) OPTS="$OPTS -D $2";shift;shift;; + + -N) NAS_IP_ADDR="-N $2";shift;shift;; + + -P) NAS_PORT="-P $2";shift;shift;; + + -u) USER_NAME="-u $2";shift;shift;; + + -U) USER_NAME="-U $2";shift;shift;; + + -x) DEBUG="-x";shift;; + + *) break;; + + esac +done + +if test "$#" != "2"; then + usage 1 >&2 +fi + + +SERVER=$1 +SECRET=$2 + +# +# Radzap is now a wrapper around radwho & radclient. +# +radwho -ZR $OPTS $NAS_IP_ADDR $NAS_PORT $USER_NAME | radclient $DEBUG $OPTS -f - $SERVER acct $SECRET |