pksteyn / php-fpmpal

PHP-FPM script that makes recommendations on max_children
GNU General Public License v3.0
55 stars 23 forks source link

Fix RHEL detection for SLES #10

Closed LukeHandle closed 8 years ago

LukeHandle commented 8 years ago

Currently picks up the duplicated version line. By excluding the commented lines, we should resolve this.

[...]
Memory available to assign to PHP-FPM pools in KB: sh: line 342: [: too many arguments
21465964 (total free memory + PHP-FPM's current memory usage)
[...]

[root@servername ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.7 (Santiago)
# This is a "SLES Expanded Support platform release 6.7"
# The above "Red Hat Enterprise Linux Server" string is only used to
# keep software compatibility.

[root@servername ~]# cat /etc/redhat-release | awk -F "release" '{print $2}' | awk '{print $1}' | cut -d. -f1
6
6

[root@servername ~]# grep -v ^# /etc/redhat-release | awk -F "release" '{print $2}' | awk '{print $1}' | cut -d. -f1
6
pksteyn commented 8 years ago

merged