From 91bdd214334bd475136f62baa5a5e9bebe6532ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 6 Jul 2017 13:45:56 +0200 Subject: [PATCH] phpquery now has non-zero exit status if live-link is missing (Courtesy of Vincent Deygas) --- phpquery | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/phpquery b/phpquery index 514b7ea..a775391 100755 --- a/phpquery +++ b/phpquery @@ -49,38 +49,34 @@ check_mod() { local live_link_content=$(get_live_link_content $version $sapi $modname $priority) found=no + local state_dir="$(get_state_dir $version $sapi)" if [ -e "${live_link}" ] ; then if [ -h "${live_link}" ] ; then local content="$(readlink "${live_link}")" if [ "${content}" = "${live_link_content}" ] ; then - found=yes + if [ -e "${state_dir}/enabled_by_admin/$modname" ]; then + output "$modname (Enabled for $sapi by local administrator)" + return 0 + elif [ -e "${state_dir}/enabled_by_maint/$modname" ]; then + output "$modname (Enabled for $sapi by maintainer script)" + return 0 + fi + output "$modname (Enabled for $sapi by unknown)" + return 0 + else + output "Module $modname symlink was modified by local administrator." + return 34 fi fi - if [ "$found" != "yes" ]; then - output "Module $modname symlink was modified by local administrator." - return 34 - fi - fi - - local state_dir="$(get_state_dir $version $sapi)" - - if [ -e "${state_dir}/enabled_by_admin/$modname" ]; then - output "$modname (Enabled for $sapi by local administrator)" - return 0 - elif [ -e "${state_dir}/enabled_by_maint/$modname" ]; then - output "$modname (Enabled for $sapi by maintainer script)" - return 0 - elif [ -e "${state_dir}/disabled_by_admin/$modname" ]; then - output "No module matches $modname (Disabled for $sapi by local administrator)" - return 32 - elif [ -e "${state_dir}/disabled_by_maint/$modname" ]; then - output "No module matches $modname (Disabled for $sapi by maintainer script)" - return 33 - elif [ "$found" = "yes" ]; then - output "$modname (Enabled for $sapi by unknown)" - return 0 else - output "No module matches $modname" + if [ -e "${state_dir}/disabled_by_admin/$modname" ]; then + output "No module matches $modname (Disabled for $sapi by local administrator)" + return 32 + elif [ -e "${state_dir}/disabled_by_maint/$modname" ]; then + output "No module matches $modname (Disabled for $sapi by maintainer script)" + return 33 + fi + output "No module matches $modname (Disabled for $sapi by unknown)" return 1 fi }