In Progress

49688 FreeBSD Batch user creation

I need a perl script. The script will take a file as input. The inputted file will be a URL of a CSV containing two fields "email" and "password". The password field is optional and may be present/absent on a line by line basis. The perl script will look through each row of data, removing non-alphanumeric characters from the password and validating proper email address formatting. The perl script will check the file at "/usr/local/etc/postfix/virtual" to see if there is already an entry there for the email address. If there is, the perl script will send an email to an administrator specifying the email address it failed to created because it already exists. The script will then skip to the next user to be created. Usernames following a format of STRINGXXX, where STRING is a hard-coded variable in the perl script, and by default will be set to "user". The script will scan the "/usr/home" directory for subdirectories that have STRING as a substring in them. It will find the highest, numerically, name user subdirectory. So, if in a directory, you have user001 user002 user003 user004 user005 The perl script will identify "user055" as the highest username, and will create the next user as "user056". The password is an optional field in the CSV. Some users will have it, some won't. If the password is blank, the perl script will autocreate a lowercase 12-character alphanumeric password. The perl script will then take the email address and extract the domain name. It will check the file "/usr/local/etc/postfix/[url removed, login to view]" for the domain in question. If it doesn't see the domain, it will add it. The perl script will revisit the file at "/usr/local/etc/postfix/virtual" and make an alias entry for the email address to the username The perl script will then issue a "postfix reload" command The perl script will then send an email to an administrator with a list of: username, password, email, status [Where status is a 1 or 0 based on if it was created] The file /usr/local/etc/postfix/virtual has the following format: #Comment #Comment #Comment #Comment email [tab] username email [tab] username email [tab] username The file /usr/local/etc/postfix/[url removed, login to view] has the following format: domain domain domain domain domain domain

Skills: Anything Goes, Perl

See more: substring in c, substring find, substring c, find substring in string c, find substring in string, find password email address, find character in string c, data input at home, data input administrator, data entry alphanumeric, c substring, c string substring, batch data entry, alphanumeric data entry, absent , virtual administrator, freebsd, batch file, hard scan, find user, numerically, script scan email, reload file, user list, blank fields

About the Employer:
( 13 reviews )

Project ID: #1798867

Awarded to:


We would love to code this in bash - will be faster and more portable.

$100 USD in 4 days
(0 Reviews)