Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 4th January 2008, 10:03
webelo webelo is offline
Junior Member
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy shell script, create bulk account

hello there,

was wondering if there is or if its easy to create a shell script that will let me add domains to a server in bulk (like 200 domain), I want to get a list of domain in a .data file, the script should read the file, create the usernames and group for each domain, set a default password, add to virtualhosting apache, create user folder /home/<user>/

Is this possible? Is there anything like this out there?

I don't know, maybe it can run like this...
cat domain.data | \
while read domain
echo "Found domain: $domain"

But than have to do the rest

Can anyone help?

Reply With Quote
Sponsored Links
Old 16th January 2008, 12:59
devnull3d devnull3d is offline
Junior Member
Join Date: Jan 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts

That shouldn't be too hard even in bash but I'd perfer to use perl. I'll attempt to throw something together (untested)
for domain in `cat domain`
 mkdir /home/$domain
 chown apache:apache /home/$domain
 cat apache_vhost_template | sed "s/domain_template/$domain" >> /etc/apache2/sites-enabled/000-default
Not exactly what you asked for but it should do the trick, of course you need to create apache_vhost_template yourself, it should look something like this
$ cat apache_vhost_template
<VirtualHost *:80>
ServerName domain_template
DocumentRoot /home/domain_template
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot SSH + ISPConfig Norman Installation/Configuration 27 26th March 2007 04:40
Verify email setup meekish Installation/Configuration 28 27th October 2006 16:36
need urgent help for writing shell script dips Programming/Scripts 8 3rd September 2006 20:40
Noob Cronjob for shell account ibackup prob Dwalf Installation/Configuration 4 1st August 2006 15:17
How to create FTP account bigger_travis Installation/Configuration 2 28th October 2005 11:03

All times are GMT +2. The time now is 12:57.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.