| |
---|
| | |
---|
| | # Program Information |
---|
| | |
---|
| | PROGNAME = "mkapachepw" |
---|
| | RCSID = "$Id: mkapachepw.py,v 1.103 2005/04/01 22:21:35 root Exp $" |
---|
| | RCSID = "$Id: mkapachepw.py,v 1.104 2005/04/01 22:30:33 root Exp $" |
---|
| | VERSION = RCSID.split()[2] |
---|
| | |
---|
| | # Copyright Information |
---|
| | |
---|
| |
---|
| | import getopt |
---|
| | import grp |
---|
| | import os |
---|
| | import pwd |
---|
| | from socket import getfqdn |
---|
| | import sys |
---|
| | import tconfpy |
---|
| | import time |
---|
| | |
---|
| |
---|
| | |
---|
| | # Files Should Be Read-Only |
---|
| | |
---|
| | os.umask(0377) |
---|
| | TIMESTAMP = "# Created By %s %s On %s At %s\n" % (PROGNAME, VERSION, getfqdn(), time.asctime()) |
---|
| | |
---|
| | # Group File |
---|
| | |
---|
| | grfile = open(GRFILE, "w") |
---|
| | grfile.write("# Created By %s %s On %s\n" % (PROGNAME, VERSION, time.asctime())) |
---|
| | grfile.write(TIMESTAMP) |
---|
| | |
---|
| | for gid in groups: |
---|
| | if gid >= STARTGID: |
---|
| | grfile.write("%s: %s\n" % (groups[gid][0], " ".join(groups[gid][1]))) |
---|
| |
---|
| | |
---|
| | # Password File |
---|
| | |
---|
| | pwfile = open(PWFILE, "w") |
---|
| | pwfile.write("# Created By %s %s On %s\n" % (PROGNAME, VERSION, time.asctime())) |
---|
| | pwfile.write(TIMESTAMP) |
---|
| | |
---|
| | for uid in users: |
---|
| | if uid >= STARTUID: |
---|
| | pwfile.write("%s:%s\n" % users[uid][:]) |
---|
| | |