Skip to content

Commit 0dcdbd5

Browse files
committed
Added two multiphp helper functions
1 parent f7f1acc commit 0dcdbd5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

func/main.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,4 +1064,18 @@ check_hestia_demo_mode() {
10641064
echo "ERROR: Unable to perform operation due to security restrictions that are in place."
10651065
exit 1
10661066
fi
1067-
}
1067+
}
1068+
1069+
multiphp_count() {
1070+
echo $(ls -d /etc/php/*/fpm/pool.d 2>/dev/null |wc -l)
1071+
}
1072+
1073+
multiphp_versions() {
1074+
if [ "$(multiphp_count)" -gt 0 ] ; then
1075+
for php_ver in $(ls /etc/php/); do
1076+
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
1077+
echo -n "$php_ver "
1078+
done
1079+
echo -en '\n'
1080+
fi
1081+
}

0 commit comments

Comments
 (0)