Hi, I need to create a web hosting service for the students at the college I work at.

I am very new to bash scripting so I only know the basics.

I have got a dedicated ubuntu 10.04 server to host the websites with.

I would like help in creating a script that does the following when run:

Ask for a desired username and password.Create a local user account on the server with the entered details.Create a MySQL user with the entered details.Create a symlink from /home/USERNAME/ to /var/www/USERNAME/

Sounds more like homework to me tbh. I'll get you pointed in the right direction though.

Ask for a desired username and password. --- look at using "read -p"Create a local user account on the server with the entered details. ----- look at using "useradd" (man useradd, pay special attention to the flags)Create a MySQL user with the entered details. ----- look at "mysql" (man mysql) also search here for mysql examples for interacting with mysql from the command line.Create a symlink from /home/USERNAME/ to /var/www/USERNAME/ ------- look at "ln" (man ln for more help)

Note the man pages are there to help you. IE: man COMMANDYOUWANTTOKNOWMOREABOUT

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum