Przeglądaj źródła

Added two multiphp helper functions

Robert Zollner 6 lat temu
rodzic
commit
0dcdbd5218
1 zmienionych plików z 15 dodań i 1 usunięć
  1. 15 1
      func/main.sh

+ 15 - 1
func/main.sh

@@ -1064,4 +1064,18 @@ check_hestia_demo_mode() {
         echo "ERROR: Unable to perform operation due to security restrictions that are in place."
         exit 1
     fi
-}
+}
+
+multiphp_count() {
+    echo $(ls -d /etc/php/*/fpm/pool.d 2>/dev/null |wc -l)
+}
+
+multiphp_versions() {
+    if [ "$(multiphp_count)" -gt 0 ] ; then
+        for php_ver in $(ls /etc/php/); do
+            [ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
+            echo -n "$php_ver "
+        done
+        echo -en '\n'
+    fi
+}