[K12OSN] How about a scripting question :-)

Jim Kronebusch jim at winonacotter.org
Thu Nov 9 20:18:32 UTC 2006


Let's say I have a group called "Staff" in /etc/group with users x,y and z. 
How would I create a script that would grab the users from the group "Staff"
and create a new file "/etc/mailusers" with all the users listed separately on
their own line?

Example:
Script reads /etc/group for the line matching Staff (I can pull that with
"grep Staff /etc/group) and the result is - 
Staff:x:501:jim,tommy,john
Then builds the new file named /etc/mailusers which is formatted like so -
jim
tommy
john

Make sense?  I would think this to be possible.  My thought is this would
answer my postfix question earlier.  I could set
"local_recipient_maps=hash:/etc/mailusers" and then have this script run after
any changes in Webmin to the users module.  The script would also have a line
at the end that ran "postmap /etc/mailusers" to update the database.

Sound feasible

Thanks,

Jim Kronebusch
Cotter Tech Department
507-453-5188


-- 
This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.




More information about the K12OSN mailing list