Added hostname to timestamp in each output file.
1 parent b3f2ed1 commit dc35a43930a818f24d4628c164c60e1ef6e275e0
@root root authored on 1 Apr 2005
Showing 1 changed file
View
8
mkapachepw.py
 
# 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][:])