diff options
Diffstat (limited to 'fooconf-unix-group')
-rwxr-xr-x | fooconf-unix-group | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fooconf-unix-group b/fooconf-unix-group new file mode 100755 index 0000000..7a30512 --- /dev/null +++ b/fooconf-unix-group @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# Hey Emacs, this is -*-python-*- code! + +from fooconflib import * + +def generateUnixGroupFragment(ctx = FooConfContext()) : + cursor = ctx.db.cursor() + cursor.execute("SELECT name, id "+ + "FROM account") + + while 1: + row = cursor.fetchone() + if row is None: break + + print "%s:x:%u:" % (ctx.makeSysUserName(row["name"]), + ctx.makeSysGID(row["id"])) + +if __name__ == "__main__": + generateUnixGroupFragment() |