I am trying to synchronise the NIS passwd list with all the apache
servers' .htaccess files. So for that I have a crontab running every 30 mins
to see if any NIS passwd is changed and if some passwd changes , all the
apache servers change the passwd in the .htaccess too. Is there any better
way of doing it apart from synchronizing? How do I allow the users to change
the NIS users online so that the change is reflected on all the systems?
Anyways as of now , I am using a script that I am not happy with.
I take the output of `ypcat passwd` and use 'sed -e "s/://" and awk print
$1,$2 to a file ( that is just the logins and passwd) and insert the colon
in the space between them again. Then I rcp it to all the servers. I'm sure
I can do it in one go, how do I just delete all the other colon stuff with
just the login:passwd.
For Example , if there's an entry like
then I replace ':' with '' (blank) and then awk $1 and $2 ie...
bern IVRsGA7auT56s and again replce '' with ':'
How do I directly get this stuff in a one liner?