if ($answer_counter == 1): ?>
endif; ?>
#!/bin/sh
echo '[mysql]' > ~/.my.cnf
echo -e 'user\t\t= root' >> ~/.my.cnf
echo -e 'password\t= <root password>' >> ~/.my.cnf
while read u; do
# 1. config in Apache
# 2. DON'T DO THIS. Why do you want to give ssh access to these users?
/usr/sbin/useradd -m -p $(perl -e 'print crypt($ARGV[0], "password")' $u) $u
# 3. Check to see if 'public_html' directory exist
[ ! -d /home/$u/public_html ] && mkdir /home/$u/public_html
echo 'Hello '$u > /home/$u/public_html/index.html
# 4. Make sure that you can login to MySQL without prompting for password
mysql -e "create database $u; grant all privileges on $u.* to $u@'localhost' identified by '$u';"
done < usernames.txt