#!/bin/bash let "loop=0" while test $loop == 0 do clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "How can I help you?" echo "------------------------------------------------------" echo "a. Invoke an editor on the apache vhosts file" echo "b. Add a user to the ftp server" echo "c. Change password of a ftp user" echo "d. Delete a ftp user" echo "e. Invoke an editor on the apache configuration" echo "f. Run statsgen" echo "g. Invoke an editor on the statsgen file" echo "h. Restart apache" echo "i. Gracefully restart apache" echo "j. Open ftpd screen" echo "k. Open MySQLd screen" echo "l. Start ftpd" echo "m. Kill ftpd" echo "n. Start MySQLd" echo "o. Kill MySQLd" echo "p. Show ftp users" echo "q. Make a new site directory" echo "------------------------------------------------------" echo "quit. Quit" echo '' echo "Please make your choice..." read choice case $choice in quit) let "loop=1" esac case $choice in a) nano /usr/local/apache2/conf/extra/httpd-vhosts.conf esac case $choice in b) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Add a user to the ftp server" echo "------------------------------------------------------" echo '' echo "Username?" read username echo "" echo "Chroot-path?" read chroot echo "" echo "System user?" read system echo "" pure-pw useradd $username -u $system -d $chroot pure-pw mkdb /etc/pure-ftpd/pureftpd.pdb echo echo "Done! press enter to return" read return esac case $choice in c) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Change password of a ftp user" echo "------------------------------------------------------" echo '' echo "Username?" read username echo "" pure-pw passwd $username pure-pw mkdb /etc/pure-ftpd/pureftpd.pdb echo "" echo "Done! press enter to return" read return esac case $choice in d) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Delete a ftp user" echo "------------------------------------------------------" echo '' echo "Username?" read username echo "" pure-pw userdel $username pure-pw mkdb /etc/pure-ftpd/pureftpd.pdb echo "" echo "Done! press enter to return" read return esac case $choice in e) nano /usr/local/apache2/conf/httpd.conf esac case $choice in f) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Run statsgen" echo "------------------------------------------------------" echo '' /var/www/genstats echo "" echo "Done! press enter to return" read return esac case $choice in g) nano /var/www/genstats esac case $choice in h) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Restart apache" echo "------------------------------------------------------" echo '' /usr/local/apache2/bin/apachectl -k restart echo "" echo "Done! press enter to return" read return esac case $choice in i) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Gracefully restart apache" echo "------------------------------------------------------" echo '' /usr/local/apache2/bin/apachectl -k graceful echo "" echo "Done! press enter to return" read return esac case $choice in j) screen -r ftpd esac case $choice in k) screen -r mysql esac case $choice in l) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Start ftpd" echo "------------------------------------------------------" echo '' screen -dmS ftpd pure-config.pl /etc/pure-ftpd/pure-ftpd.conf echo "" echo "Done! press enter to return" read return esac case $choice in m) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Kill ftpd" echo "------------------------------------------------------" echo '' skill pure-ftpd echo "" echo "Done! press enter to return" read return esac case $choice in n) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Start MySQLd" echo "------------------------------------------------------" echo '' screen -dmS mysql /usr/local/mysql/bin/mysqld_safe --user=mysql echo "" echo "Done! press enter to return" read return esac case $choice in o) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Kill MySQLd" echo "------------------------------------------------------" echo '' skill mysqld skill mysql echo "" echo "Done! press enter to return" read return esac case $choice in p) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Show ftp users" echo "------------------------------------------------------" echo '' pure-pw list echo "" echo "Done! press enter to return" read return esac case $choice in q) clear echo 'Server Management console' echo 'Copyright 2007 Maikel Gommans.' echo 'http://www.maikelg.eu' echo '' echo "Make a new site directory" echo "------------------------------------------------------" echo '' echo "Name?" read name echo "" cd /var/www/sites cp -R skel $name echo "" echo "Done! press enter to return" read return esac done clear