Skip to content

Commit

Permalink
Update nodejs-apps.bash
Browse files Browse the repository at this point in the history
Signed-off-by: moodyblue <hugo.castelobranco@gmail.com>
  • Loading branch information
moodyblue authored Oct 7, 2024
1 parent d7a1045 commit e33306a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions functions/nodejs-apps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ zigbee2mqtt_setup() {
local installText="Zigbee2MQTT is installed from the official repository.\\n\\nPlease wait about 4 minutes... "
local uninstallText="Zigbee2MQTT is completely removed from the system."
local adapterText="Please select your zigbee adapter:"
local adapterNetw="\\nNo USB dongle was found. If you use a network adapter please specify its ip:port."
local adapterNetw="\\nPlease specify the ip:port of the zigbee coordinator."
local mqttUserText="\\nPlease enter your MQTT-User (default = openhabian):"
local mqttPWText="\\nIf your MQTT-server requires a password, please enter it here:"
local my_adapters
Expand Down Expand Up @@ -316,12 +316,17 @@ zigbee2mqtt_setup() {
# ask for user input parameters
if [[ -n $INTERACTIVE ]]; then
if ! (whiptail --title "Zigbee2MQTT installation" --yes-button "Continue" --no-button "Cancel" --yesno "$introText" 14 80); then echo "CANCELED"; return 0; fi
if [[ $my_adapters == "" ]] ; then
# No usb dongle found. ask user to specify network dongle ip
# shellcheck disable=SC2086
if ! zigmode=$(whiptail --title "Zigbee2MQTT installation" --menu "Choose mode:" 14 100 2 --cancel-button "Cancel" --ok-button "Continue" \
"usb" "The zigbee coordinator is directly connected to this computer." \
"network" "The zigbee coordinator is connected to the LAN and has an IP address." \
3>&1 1>&2 2>&3); then echo "CANCELED"; return 0; fi
# shellcheck disable=SC2086

if [[ $zigmode == "network" ]] ; then
if ! selectedAdapter=$(whiptail --title "Zigbee Network Coordinator" --inputbox "$adapterNetw" 10 80 "xxx.xxx.xxx.xxx:port" 3>&1 1>&2 2>&3); then return 0; fi
by_path_or_id="tcp:/"
else
# shellcheck disable=SC2086
if ! selectedAdapter=$(whiptail --noitem --title "Zigbee2MQTT installation" --radiolist "$adapterText" 14 100 4 $my_adapters 3>&1 1>&2 2>&3); then return 0; fi
fi
if ! mqttUser=$(whiptail --title "MQTT User" --inputbox "$mqttUserText" 10 80 "$mqttDefaultUser" 3>&1 1>&2 2>&3); then return 0; fi
Expand Down

0 comments on commit e33306a

Please sign in to comment.