|
From: | Craig Nelson |
Subject: | RE: Editfiles convergence bug |
Date: | Wed, 19 Feb 2003 16:47:40 -0800 |
I ended up with the following ugly pile to ensure that a user existed and had the right UID accross all of our systems. Please excuse the wrapping, these are long lines. The order is important to satisfy the user* and group* scripts, cannot delete the group before the user or add the user before the group.
This works on RedHat 6.2, 7.2, and 7.3.
editfiles:
# add bigbro user to passwd and group files
managedhosts.bigbrother::
{ /etc/group
SetScript "/home/bigbro/bb/runbb.sh stop;sleep 1;
/usr/sbin/userdel -r bigbro;/usr/sbin/groupdel bigbro;
/usr/sbin/groupadd -g 400 bigbro;
/usr/sbin/useradd -c BigBrother -u 400 -g 400 bigbro;ls"
RunScriptIfNoLineMatching "^bigbro:x:400:.*"
DefineClasses bigbrotherupdate
LocateLineMatching "^bigbro:x:400:.*"
}
{ /etc/passwd
SetScript "/usr/sbin/groupdel bigbro;/usr/sbin/groupadd -g 400 bigbro;ls"
SetScript "/home/bigbro/bb/runbb.sh stop;sleep 1;
/usr/sbin/userdel -r bigbro;/usr/sbin/groupdel bigbro;
/usr/sbin/groupadd -g 400 bigbro;
/usr/sbin/useradd -c BigBrother -u 400 -g 400 bigbro;ls"
RunScriptIfNoLineMatching "^bigbro:x:400:400:.*"
DefineClasses bigbrotherupdate
LocateLineMatching "^bigbro:x:400:400:.*"
}
-------------------------------------------------------------------------------------------
The contents of this email are confidential. If you are not, or believe you may not be, the intended recipient of this email, please let us know by reply and then delete it from your system. You should not copy the message or disclose its contents to anyone. No warranty or other assurance is given by us that this email is free of any virus or any other defect or error.
[Prev in Thread] | Current Thread | [Next in Thread] |