-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathchfn
executable file
·16 lines (13 loc) · 892 Bytes
/
chfn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /usr/bin/env python
from manageldap import *
import argparse, getpass
# chfn [-f full_name] [-r room_no] [-w work_ph] [-h home_ph] [-o other] [user]
parser = argparse.ArgumentParser(description="Modify user information in the LDAP Directory.")
parser.add_argument('-f','--fullname',type=str,help='The new full name of the user.',default="")
parser.add_argument('-r','--roomno',type=str,help='The new room number of the user',default="")
parser.add_argument('-w','--phone',type=str,help='The new phone number of the user',default="")
parser.add_argument('-o','--other',type=str,help='The new value for the other field of the user',default='')
parser.add_argument("login",type=str,help='The username whose information is being modified.')
args = parser.parse_args()
moddeduser = usermod(args.login,room=args.roomno,name=args.fullname,phone=args.phone,other=args.other)
update(moddeduser)