From 2877a2826dcbe12f33c94eac87e2af5d23bbbd4f Mon Sep 17 00:00:00 2001 From: nachoparker Date: Thu, 27 Apr 2017 18:21:55 +0200 Subject: return to menu in nextcloudpi-config --- bin/nextcloudpi-config | 24 +++++++++++++----------- etc/library.sh | 3 +-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/bin/nextcloudpi-config b/bin/nextcloudpi-config index fc3fda21..edb66f57 100755 --- a/bin/nextcloudpi-config +++ b/bin/nextcloudpi-config @@ -38,19 +38,21 @@ function nextcloud-config() local DESC=$( grep "DESCRIPTION=" $item | sed 's|^DESCRIPTION="||;s|"$||' ) LIST+=( $( basename $item .sh ) "$DESC" ) done - local script - script=$( whiptail --backtitle "$BACKTITLE $( cat /usr/local/etc/ncp-version )" \ - --title "NextCloudPi Software Configuration Tool (nextcloudpi-config)" \ - --cancel-button Finish --ok-button Select \ - --menu "Select program to configure and activate:" 20 100 10 \ - "${LIST[@]}" \ - 3>&1 1>&2 2>&3 ) + while true; do + local script + script=$( whiptail --backtitle "$BACKTITLE $( cat /usr/local/etc/ncp-version )" \ + --title "NextCloudPi Software Configuration Tool (nextcloudpi-config)" \ + --cancel-button Finish --ok-button Select \ + --menu "Select program to configure and activate:" 20 100 10 \ + "${LIST[@]}" \ + 3>&1 1>&2 2>&3 ) - [[ $? -ne $DIALOG_OK ]] || [[ "$script" == "" ]] && return 0 + [[ $? -ne $DIALOG_OK ]] || [[ "$script" == "" ]] && return 0 - # launch selected script - info_script $script.sh || return 1; - configure_script $script.sh + # launch selected script + info_script $script.sh || continue; + configure_script $script.sh + done } if [ $(id -u) -ne 0 ]; then diff --git a/etc/library.sh b/etc/library.sh index aeb5fd97..76e4cc16 100755 --- a/etc/library.sh +++ b/etc/library.sh @@ -162,7 +162,6 @@ function config() case $RET in $DIALOG_CANCEL) - echo "Aborted" return 1 ;; $DIALOG_OK) @@ -220,7 +219,7 @@ function configure_script() ( local SCRIPT=$1 cd /usr/local/etc/nextcloudpi-config.d/ - config $SCRIPT || return 1 # writes "$INSTALLATION_CODE" + config $SCRIPT || return 0 # writes "$INSTALLATION_CODE" echo -e "$INSTALLATION_CODE" > $SCRIPT # save configuration source ./$SCRIPT # load configuration echo -e "Configuring \e[1m$( basename $SCRIPT .sh )\e[0m" -- cgit v1.2.3