From 67d93201704593f42fd235ffd28bed5bf88c3693 Mon Sep 17 00:00:00 2001 From: "Keith F. Kelly" Date: Tue, 30 Jun 2020 23:45:17 -0700 Subject: [PATCH 1/2] Add missign printMsgs function. --- other_authors/wifi.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/other_authors/wifi.sh b/other_authors/wifi.sh index b378992..d2b8510 100644 --- a/other_authors/wifi.sh +++ b/other_authors/wifi.sh @@ -16,6 +16,24 @@ #rp_module_section="config" #rp_module_flags="!x11" +## @fn printMsgs() +## @param type style of display to use - dialog, console or heading +## @param message string or array of messages to display +## @brief Prints messages in a variety of ways. +function printMsgs() { + local type="$1" + shift + if [[ "$__nodialog" == "1" && "$type" == "dialog" ]]; then + type="console" + fi + for msg in "$@"; do + [[ "$type" == "dialog" ]] && dialog --backtitle "$__backtitle" --cr-wrap --no-collapse --msgbox "$msg" 20 60 >/dev/tty + [[ "$type" == "console" ]] && echo -e "$msg" + [[ "$type" == "heading" ]] && echo -e "\n= = = = = = = = = = = = = = = = = = = = =\n$msg\n= = = = = = = = = = = = = = = = = = = = =\n" + done + return 0 +} + function _set_interface_wifi() { local state="$1" From dc4d190470f9754e78f4d384f4b7a31529e6ad3e Mon Sep 17 00:00:00 2001 From: "Keith F. Kelly" Date: Tue, 30 Jun 2020 23:45:17 -0700 Subject: [PATCH 2/2] add missing printMsgs function --- other_authors/wifi.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/other_authors/wifi.sh b/other_authors/wifi.sh index b378992..d2b8510 100644 --- a/other_authors/wifi.sh +++ b/other_authors/wifi.sh @@ -16,6 +16,24 @@ #rp_module_section="config" #rp_module_flags="!x11" +## @fn printMsgs() +## @param type style of display to use - dialog, console or heading +## @param message string or array of messages to display +## @brief Prints messages in a variety of ways. +function printMsgs() { + local type="$1" + shift + if [[ "$__nodialog" == "1" && "$type" == "dialog" ]]; then + type="console" + fi + for msg in "$@"; do + [[ "$type" == "dialog" ]] && dialog --backtitle "$__backtitle" --cr-wrap --no-collapse --msgbox "$msg" 20 60 >/dev/tty + [[ "$type" == "console" ]] && echo -e "$msg" + [[ "$type" == "heading" ]] && echo -e "\n= = = = = = = = = = = = = = = = = = = = =\n$msg\n= = = = = = = = = = = = = = = = = = = = =\n" + done + return 0 +} + function _set_interface_wifi() { local state="$1"