Well, I tried it, and it will insert the -disconnect 09-19-02 for the correct username, but it isn't updating the dc.users.notfound correctly.
Try it using these files:
dc.users:
bob
steve
mark
users:
tom Password = "xxxxx"
steve Password =...
I'll try the above in a test run...
But to answer you question about what info goes in what file...
The dc.user file only has the names of customers in the user file that need to be disconnected.
dc.users :
joe
steve
mark
The users file is the actual radius file that our customers...
I made the changes to the script. It now looks like this:
BEGIN {
myDomain="@mounet.com"
num = 0
while ((getline < "dc.users") > 0) {
nam[num] = $0
num++
}
}
{
ATdomain=$1 myDomain
for (j=0;j<num;j++) {
if ( ($1 ~...
Yep, that looks about like what i'm looking for..
One question though.
Are the variables right in the modified script above? I would think it should look like this... Maybe i'm wrong.
...
myDomain="@domain.com"
...
ATdomain=$1 myDomain
for (j=0;j<num;j++) {
if ( ($1 ~...
I have this current script, that a few of you helped me get working a few weeks ago. Thanks everybody. Now I need to modify it to be a little more flexible.
BEGIN {
num = 0
while ((getline < "dc.users") > 0) {
nam[num] = $0
num++
}
}
{
for (j=0;j<num;j++) {...
Thanks CaKiwi.
The script seems to work great except for one thing. It doesn't preserve the format of the original user file.
I have saved the script in a file called automate.
automate:
BEGIN {
num = 0
while ((getline < "file.users") > 0) {
nam[num] = $0
num++...
Thanks again to everyone.
I have one more question and hopefully i'll be finished.
Taking the previous posting:
awk -v name=bob -v date=`date +%m-%d-%y` '
{ if ($1 ~ "^"name"$")
$4 = substr($4, 1, length($4)-1) " discontinued " date "\"";
}
{...
Thanks Ed. Thats a start, and that answers my question. The problem is, I didn't word my question correctly. :-)
Let me try again...
I need to open a file i'll call "radius" and do a line by line search the field $1 for a variable i'll call "bob" and append some text to...
Hello all,
I'm new to this site and have what I hope is a simple AWK problem...
I need to search a file and add text to a line if the criteria is correct.
If I have the following file:
bob Password = "password"
Service-Type=Framed-User
Session-Timeout=9000...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.