> Does anyone have an adduser program/script for Radius? We just bought
> two USR Total Control/16 boxes, which use radius and I really don't want
> to have to edit the /etc/raddb/users file every time we add a user, and
> since every user will be getting an account on our server at the same
> time I want a way to add it to my current adduser program... So I can
> fill out one form and everything is done at one time.
>
> -----KaZen
> kazen@viptx.net
>
I made this script based on some radius "addppp" program I found, I write
sloppy code, so don't make too much fun of it. :)
As far as adding it to the unix program "adduser", don't think you'll
find much luck there, I always end up with just running this and adduser
to add them to the /etc/passwd file.
If anyone else has a better system, I'd like to hear about it.
Joe Boyce
Computer Zone Internet
joe@c-zone.net
----------------------------begin sloppy code---------------
#!/bin/bash
echo -n "Enter login name: "
read loginname
echo -n "Enter password: "
read password
if test -e "/tmp/exists.hmm "; then
rm -f /tmp/exists.hmm
fi
grep -l -w -e "$loginname" /etc/raddb/users > /tmp/exists.hmm
if test -s "/tmp/exists.hmm" ; then
rm -f /tmp/exists.hmm
echo 'You suck.. '"$loginname"' is already a user on this system.'
else
echo "$loginname"' Password = "'"$password"'",' > /tmp/temp.dat
echo ' User-Service-Type = Framed-User,' >> /tmp/temp.dat
echo ' Framed-Protocol = PPP,' >> /tmp/temp.dat
echo ' Framed-Address = 255.255.255.254,' >> /tmp/temp.dat
echo ' Framed-Netmask = 255.255.255.255,' >> /tmp/temp.dat
echo ' Framed-Routing = None,' >> /tmp/temp.dat
echo ' Framed-Compression = Van-Jacobsen-TCP-IP,' >> /tmp/temp.dat
echo ' Framed-Filter-Id = "std.ppp",' >> /tmp/temp.dat
echo ' Framed-MTU = 1500' >> /tmp/temp.dat
echo >> /tmp/temp.dat
cat /tmp/temp.dat >> /etc/raddb/users
rm -f /tmp/temp.dat
echo "$loginname"' was successfully added.'
fi