#!/bin/bash # # add radius users to some files specified by kyle # For FreeRADIUS config files # # Brett Krueger # Rooted Networks # 2000-2004 # http://www.rootednetworks.com # sigterm@rootednetworks.com # # # ask for username first if test "$1" = '' then echo "Please enter a username to add." else if test "$2" = '' then echo "Please enter password for user" else if test "$3" = '' then echo "Please enter users first 3 digits of phone number.)" else echo " $1 Auth-Type := Local, User-Password == \"$2\" Framed-Protocol = PPP, Fall-Through = Yes " >> /tmp/$3.users cat /tmp/$3.users >> /usr/local/etc/raddb/$3.users echo "Added user: $1" echo "with password: $2" echo "to file $3.users" #clear tmp file when done echo "clearing tmp directory" rm /tmp/$3.users echo "All done" fi fi fi