diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-09-07 23:36:35 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-09-07 23:38:44 +0300 |
commit | e7e07863ce98b3c98412c87fdfb73ffcc4edb698 (patch) | |
tree | 24a0e69bb35bd2933a5c18e3b04794d3eb3ca1f7 /etc/library.sh | |
parent | 74c8d956096683b380f51a78a62bf917fb1f213b (diff) |
refactor show_info(), make it only depend on variablesv0.26.18
Diffstat (limited to 'etc/library.sh')
-rwxr-xr-x | etc/library.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/library.sh b/etc/library.sh index 58101d22..ad4f0072 100755 --- a/etc/library.sh +++ b/etc/library.sh @@ -220,15 +220,17 @@ function launch_script() ) } +# show an info box for a script if the INFO variable is set in the script function info_script() { ( local SCRIPT=$1 cd /usr/local/etc/nextcloudpi-config.d/ || return 1 - unset show_info + unset show_info INFO INFOTITLE source ./"$SCRIPT" - [[ $( type -t show_info ) == function ]] || return 0 - [[ $( type -t show_info ) == function ]] && show_info + local INFOTITLE="${INFOTITLE:-Info}" + [[ "$INFO" == "" ]] && return 0 + whiptail --yesno --backtitle "NextCloudPi configuration" --title "$INFOTITLE" "$INFO" 20 90 ) } |