DocSpace-buildtools/build/install/OneClickInstall/install-RedHat/check-ports.sh
Evgeniy Antonyuk 4e5bd47c26
Feature/rpm update (#229)
* Add a build and install new services

* Change the packaging for the new build script

* Correct the configuration

* Add a bug fix with a mysql password containing ';'

* Fix services crash error

* Fix incorrect value addition in mysql

* Fix a rabbitmq error on CentOS 8

* Fix creating an invalid mysql password

* Fix non-existent tables Tenants

* Add an update to 1click

* Code correction

* Add two new services

* Add the buildpath variable

* Code Optimization

* Renaming services and creating a variable for the app name

* Revert "Merge branch 'feature/rpm-update' of https://github.com/ONLYOFFICE/AppServer into feature/rpm-update"

This reverts commit 19c1eae6f6e3f22f4cbc0e3276fa892b0d9fa97a, reversing
changes made to fb36a996366291486e3b9f5a6f46398916ef8a6c.

* Code Optimization

* Code optimization

* Code optimization and creating a variables
2021-05-20 17:39:38 +03:00

40 lines
1.1 KiB
Bash

#!/bin/bash
set -e
cat<<EOF
#######################################
# CHECK PORTS
#######################################
EOF
if rpm -qa | grep ${package_sysname}-${product}; then
echo "${package_sysname}-${product} $RES_APP_INSTALLED"
APPSERVER_INSTALLED="true";
elif [ "${UPDATE}" != "true" ] && netstat -lnp | awk '{print $4}' | grep -qE ":80$|:8081$|:8083$|:5001$|:5002$|:8080$|:80$"; then
echo "${package_sysname}-${product} $RES_APP_CHECK_PORTS: 80, 8081, 8083, 5001, 5002, 9200, 2181, 9092";
echo "$RES_CHECK_PORTS"
exit
else
APPSERVER_INSTALLED="false";
fi
if rpm -qa | grep ${package_sysname}-documentserver; then
echo "${package_sysname}-documentserver $RES_APP_INSTALLED"
DOCUMENT_SERVER_INSTALLED="true";
elif [ "${UPDATE}" != "true" ] && netstat -lnp | awk '{print $4}' | grep -qE ":8083$|:5432$|:5672$|:6379$|:8000$|:8080$"; then
echo "${package_sysname}-documentserver $RES_APP_CHECK_PORTS: 8083, 5432, 5672, 6379, 8000, 8080";
echo "$RES_CHECK_PORTS"
exit
else
DOCUMENT_SERVER_INSTALLED="false";
fi
if [ "$APPSERVER_INSTALLED" = "true" ] || [ "$DOCUMENT_SERVER_INSTALLED" = "true" ]; then
if [ "$UPDATE" != "true" ]; then
exit;
fi
fi