[fix] correct SUDO and make sure all plugins are loaded in non build version

This commit is contained in:
alban 2020-05-21 20:45:38 +02:00
parent 06a6aded5a
commit 3974567080

View File

@ -10,7 +10,9 @@ CHANGELOG=/etc/changelog
[[ -f "$APP_PATH/config.sh" ]] && source "$APP_PATH/config.sh" [[ -f "$APP_PATH/config.sh" ]] && source "$APP_PATH/config.sh"
# Sanity check on changelog file # 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" echo -e "\nYou cannot write to $CHANGELOG... This doesn't look serious!\n"
read -e -i y -n 1 -p "Run as sudo [Yn]? : " read -e -i y -n 1 -p "Run as sudo [Yn]? : "
[[ "Y" == ${REPLY^} ]] && sudo -E "$APP_PATH/$APP_NAME" && exit 0 [[ "Y" == ${REPLY^} ]] && sudo -E "$APP_PATH/$APP_NAME" && exit 0
@ -88,7 +90,7 @@ PLUGIN_OUTPUT+=("hookOutputFile")
declare -a PLUGIN_OUTPUT_MENU declare -a PLUGIN_OUTPUT_MENU
# %PLUGIN% This comment is used to build custom scripts # %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 for (( i = 0; i < ${#PLUGIN_OUTPUT[@]} ; i++ )); do
TXT=$( ${PLUGIN_OUTPUT[$i]} ) TXT=$( ${PLUGIN_OUTPUT[$i]} )