#1359 pull function into main menu file

This commit is contained in:
rootzoll 2020-07-23 11:41:11 +02:00
parent 286c1ea371
commit 75c8bfe1a9
2 changed files with 25 additions and 28 deletions

View File

@ -8,13 +8,34 @@ configFile="/mnt/hdd/raspiblitz.conf"
# INFOFILE - state data from bootstrap
infoFile="/home/admin/raspiblitz.info"
# CONFIRMATIONFILE - confirmation dialog
confirmationFile="/home/admin/XXconfirmation.sh"
# MAIN MENU AFTER SETUP
source ${infoFile}
source ${configFile}
source ${confirmationFile}
# FUNCTIONS
confirmation()
{
local text=$1
local yesButtonText=$2
local noButtonText=$3
local defaultno=$4
local height=$5
local width=$6
local answer=-100
if [ $defaultno ]; then
whiptail --title " Confirmation " --defaultno --yes-button "$yesButtonText" --no-button "$noButtonText" --yesno " $text
" $height $width
else
whiptail --title " Confirmation " --yes-button "$yesButtonText" --no-button "$noButtonText" --yesno " $text
" $height $width
fi
answer=$?
return $answer
}
# get the local network IP to be displayed on the lCD
localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | grep 'eth0\|wlan0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')

View File

@ -1,24 +0,0 @@
#!/bin/bash
confirmation()
{
local text=$1
local yesButtonText=$2
local noButtonText=$3
local defaultno=$4
local height=$5
local width=$6
local answer=-100
if [ $defaultno ]; then
whiptail --title " Confirmation " --defaultno --yes-button "$yesButtonText" --no-button "$noButtonText" --yesno " $text
" $height $width
else
whiptail --title " Confirmation " --yes-button "$yesButtonText" --no-button "$noButtonText" --yesno " $text
" $height $width
fi
answer=$?
return $answer
}