| | |
| | | |
| | | echo "This application will update ISPConfig 3 on your server.\n"; |
| | | |
| | | //** TODO: all other queries, for testing I will setup everything in $conf |
| | | |
| | | //** Initialize the MySQL server connection |
| | | include_once('lib/mysql.lib.php'); |
| | | |
| | |
| | | system("mysql -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." ".$conf['mysql']['database']." < existing_db.sql"); |
| | | } |
| | | |
| | | //** Shall the services be reconfigured during update |
| | | $reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', 'yes,no','yes'); |
| | | |
| | | if($reconfigure_services_answer == 'yes') { |
| | | //** Configure postfix |
| | | $inst->configure_postfix('dont-create-certs'); |
| | | |
| | |
| | | //** Configure Apache |
| | | swriteln('Configuring Apache'); |
| | | $inst->configure_apache(); |
| | | } |
| | | |
| | | //** Configure ISPConfig |
| | | swriteln('Installing ISPConfig'); |
| | | swriteln('Updating ISPConfig'); |
| | | $inst->install_ispconfig(); |
| | | |
| | | //** Configure ISPConfig |
| | | swriteln('Installing Crontab'); |
| | | //** Configure Crontab |
| | | $update_crontab_answer = $inst->simple_query('Reconfigure Services?', 'yes,no','yes'); |
| | | if($update_crontab_answer == 'yes') { |
| | | swriteln('Updating Crontab'); |
| | | $inst->install_crontab(); |
| | | } |
| | | |
| | | //** Restart services: |
| | | if($reconfigure_services_answer == 'yes') { |
| | | swriteln('Restarting services ...'); |
| | | system("/etc/init.d/mysql restart"); |
| | | system("/etc/init.d/postfix restart"); |
| | |
| | | system("/etc/init.d/apache2 restart"); |
| | | system("/etc/init.d/pure-ftpd-mysql restart"); |
| | | system("/etc/init.d/mydns restart"); |
| | | } |
| | | |
| | | echo "Update finished.\n"; |
| | | |