From 39745670802042323bebb15fd7f66024f9f65263 Mon Sep 17 00:00:00 2001 From: alban Date: Thu, 21 May 2020 20:45:38 +0200 Subject: [PATCH] [fix] correct SUDO and make sure all plugins are loaded in non build version --- changelog.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.sh b/changelog.sh index a17ad0c..fa37754 100755 --- a/changelog.sh +++ b/changelog.sh @@ -10,7 +10,9 @@ CHANGELOG=/etc/changelog [[ -f "$APP_PATH/config.sh" ]] && source "$APP_PATH/config.sh" # Sanity check on changelog file -[[ -f "$CHANGELOG" ]] && [[ ! -w "$CHANGELOG" ]] && { +[[ -f "$CHANGELOG" ]] && [[ ! -w "$CHANGELOG" ]] && RUN_SUDO=1 +[[ ! -f "$CHANGELOG" ]] && ! touch /etc/changelog &>/dev/null && RUN_SUDO=1 +[[ $RUN_SUDO -eq 1 ]] && { echo -e "\nYou cannot write to $CHANGELOG... This doesn't look serious!\n" read -e -i y -n 1 -p "Run as sudo [Yn]? : " [[ "Y" == ${REPLY^} ]] && sudo -E "$APP_PATH/$APP_NAME" && exit 0 @@ -88,7 +90,7 @@ PLUGIN_OUTPUT+=("hookOutputFile") declare -a PLUGIN_OUTPUT_MENU # %PLUGIN% This comment is used to build custom scripts -[[ -d "$APP_PATH/plugins-enabled" ]] && [[ -n "$APP_PATH/plugins-enabled/*" ]] && source "$APP_PATH"/plugins-enabled/* +[[ -d "$APP_PATH/plugins-enabled" ]] && [[ -n "$APP_PATH/plugins-enabled/*" ]] && for plugin in "$APP_PATH"/plugins-enabled/*; do source $plugin; done for (( i = 0; i < ${#PLUGIN_OUTPUT[@]} ; i++ )); do TXT=$( ${PLUGIN_OUTPUT[$i]} )