I have a script that runs a last of usernames and passwords though and htpasswd command - i output the stdout to a log file which is hundreds of thousands of line long.
Code:
/usr/local/apache2/bin/htpasswd -b $file $user $pass
Code:
Adding user: unknownl
Adding password for user unknown1
Adding user: unknown2
Adding password for user unknown2
Adding user: unknown3
Adding password for user unknown3
Adding user: varmand
Adding password for user varmand
Adding user: mustest
Adding password for user emustest
Adding user: dbtest1
Adding password for user dbtest1
I want to set up a check script that will look for anything out of the ordinary in the htpasswd hash creation.
like if there is an
Code:
"Adding user: $user"
line
there must be complemented with a line right after it that says:
Code:
Adding password for user $user
- like is has to be for the same user.
If the two lines do not follow that format - there must be some error. I tried using backreferences in perl, but I am drawing a blank.
Does anyone have any ideas on how i could approach this.