From 4a1ea5292606b21537414f8430f8914031531323 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Fri, 15 Jan 2021 06:52:28 +0100 Subject: [PATCH] pecl.sh Feature: - open PHP info page only if available update --- plugins.d/pecl.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins.d/pecl.sh b/plugins.d/pecl.sh index cb584a4..f69ce94 100755 --- a/plugins.d/pecl.sh +++ b/plugins.d/pecl.sh @@ -126,7 +126,7 @@ notif2="$conf_php was modified in the last 5 minutes" if [ "$display_info" = true ]; then echo -e "php.ini path: ${bold}$conf_php${reset}" - echo -e "Additionnals ini files:\n $(ls $dir/conf.d/*.ini)" + echo -e "Additionnals ini files:\n$(ls $dir/conf.d/*.ini)" echo -e "\nTo change php version: ${italic}$ sphp 7.4${reset}" echo -e "${italic}https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2${reset}\n" @@ -141,10 +141,12 @@ if [ -n "$test" ]; then notification "$notif2" echo "" - a=$(echo -e "Do you want to edit ${bold}$conf_php${reset} file ? (y/n)") - read -p "$a" choice - if [ "$choice" == "y" ]; then - $EDITOR "$conf_php" + if [ -n "$available" ]; then + a=$(echo -e "Do you want to edit ${bold}$conf_php${reset} file ? (y/n)") + read -p "$a" choice + if [ "$choice" == "y" ]; then + $EDITOR "$conf_php" + fi fi fi