zpanel / installers

Provides a central place to store, version and distribute ZPanel installers and upgrade scripts from.
http://www.zpanelcp.com
GNU General Public License v3.0
73 stars 154 forks source link

Add check if packages are installed #22

Closed ghost closed 10 years ago

ghost commented 10 years ago

Install will exit if we detect apache / mySQL mainly using a sleek command: http://www.rpm.org/max-rpm/ch-rpm-verify.html

rpm -q httpd rpm -q mysqld

This could avoid problems for those who don't understand what minimal install means

OR

rpm -q httpd mysql postfix bind dovecot php

We could code

if rpm -q php httpd mysql bind postfix dovecot; then echo "You appear to have a server with apache/mysql/bind/postfix already installed; " echo "This installer is designed to install and configure ZPanel on a clean OS " echo "installation only!" echo "" echo "Please re-install your OS before attempting to install using this script." exit exit fi

We could even make the opposite test on updater as it will run only on systems that have the core zpanel packages already setup. IF any missing would then stop.

ghost commented 10 years ago

Same we could do over ubuntu: dpkg --get-selections | grep apache to detect apache & so on mySQL. most problems are related to mySQL.

OR

dpkg -s apache like here:

http://stackoverflow.com/questions/1298066/check-if-a-package-is-installed-and-then-install-it-if-its-not

Ubuntu can get test same as above for centos.