Commit d1641e7f authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Few bugfixes

parent 28877e0d
......@@ -152,8 +152,8 @@ function jobs ()
exit
elif [[ -n $CURRENT_UUID ]]; then
dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse \
--yesno "\nAlready connected via wireless.\n\nDo you want to disconnect?" 9 57
[[ $? = 0 ]] && nmcli connection down uuid $CURRENT_UUID
--yesno "\nAlready connected to $WIFICONNECTED.\n\nDo you want to disconnect?" 9 57
[[ $? = 0 ]] && nmcli connection down uuid $CURRENT_UUID > /dev/null 2>&1
else
# disable AP mode on certain adapters
wlan_exceptions "off"
......@@ -183,11 +183,8 @@ function jobs ()
elif [[ -n $CURRENT_UUID ]]; then
dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse \
--yesno "\nWireless connection is in use.\n\nDo you want to disconnect?" 9 57
[[ $? = 0 ]] && nmcli connection down uuid $CURRENT_UUID
[[ $? = 0 ]] && nmcli connection down uuid $CURRENT_UUID 2> /dev/null
else
# check if user agree to enter this area
beta_disclaimer "Wireless networking in Linux is problematic. Our tools make it easy for some cases but can't enable AP on every random WiFi chip. If this tool fail, check manual methods."
if [[ -n $ACKNOWLEDGEMENT ]]; then
# change special adapters to AP mode
wlan_exceptions "on"
# check for WLAN interfaces
......@@ -303,7 +300,6 @@ function jobs ()
mv $TEMP_CONF /etc/network/interfaces
reboot
fi
fi
fi
;;
......@@ -351,14 +347,17 @@ function jobs ()
# Freeze and unfreeze kernel and board support packages
#
"Hold" | "Unhold" )
dialog --title "Update" --backtitle "$BACKTITLE" --yes-label "$selection" --no-label "Cancel" \
--yesno "\nDo you want to ${selection,,} kernel updates?" 7 50
dialog --title "Update" --backtitle "$BACKTITLE" --yes-label "$1" --no-label "Cancel" \
--yesno "\nDo you want to ${1,,} kernel updates?" 7 50
if [[ $? = 0 ]]; then
TARGET_BRANCH=$BRANCH
exceptions "$BRANCH"
PACKAGE_LIST="linux-image${TARGET_BRANCH}-${TARGET_FAMILY} linux-headers${TARGET_BRANCH}-${TARGET_FAMILY} linux-u-boot-${BOARD}-${UBOOT_BRANCH} linux-$(lsb_release -cs)-root$TARGET_BRANCH-$BOARD"
[[ $BRANCH != "default" ]] && PACKAGE_LIST=$PACKAGE_LIST" linux-dtb$TARGET_BRANCH-$TARGET_FAMILY"
apt-mark ${selection,,} $PACKAGE_LIST | dialog --backtitle "$BACKTITLE" --title "Package locking" --progressbox 7 64
local words=( $PACKAGE_LIST )
apt-mark ${1,,} $PACKAGE_LIST | dialog --backtitle "$BACKTITLE" --title "Packages ${1,,}" --progressbox $((${#words[@]}+2)) 64
fi
;;
......
......@@ -68,7 +68,6 @@ function get_ip_addresses() {
DISTRO=$(lsb_release -is)
DISTROID=$(lsb_release -sc)
KERNELID=$(uname -r)
WIFICONNECTED=$(nmcli -f NAME connection show --active | tail -n +2 | tail -1)
BACKTITLE="Configuration utility, $ARMBIAN, https://www.armbian.com"
TITLE="$BOARD_NAME "
IPADDRESS=$(get_ip_addresses)
......@@ -339,7 +338,7 @@ while true; do
if [[ -n $(service hostapd status | grep -w active | grep -w running) ]]; then
[[ -n $(nmcli -f DEVICE,TYPE device status | grep wifi) ]] && LIST+=( "Hotspot" "Manage WiFi access point" )
else
[[ -n $(nmcli -f DEVICE,TYPE device status | grep wifi) ]] && LIST+=( "WiFi" "Connect to wireless access point" )
[[ -n $(nmcli -f DEVICE,TYPE device status | grep wifi) ]] && LIST+=( "WiFi" "Manage wireless networking" )
[[ -n $(nmcli -f DEVICE,TYPE device status | grep wifi) ]] && LIST+=( "Hotspot" "Create WiFi access point" )
fi
[[ $(hcitool dev | sed '1d') != "" && -n $(service bluetooth status | grep -w active | grep -w running) ]] && LIST+=( "Bluetooth" "Connect Bluetooth devices" )
......@@ -348,14 +347,22 @@ while true; do
# count number of menu items to adjust window sizee
LISTLENGHT="$((11+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]}
WIFICONNECTED=$(nmcli -f NAME,TYPE connection show --active | grep wireless | awk 'NF{NF-=1};1')
# display warning only we have wifi
if [[ " ${LIST[*]} " == *" Hotspot "* ]]; then
local disclaimer="\nNote: wireless networking in Linux is problematic. Our tools make it easy for some cases but can't enable AP on every random WiFi chip. If this tool fail, you are on your own.\n "
else
LISTLENGHT="$((6+${#LIST[@]}/2))"
disclaimer=""
if [[ -n $WIFICONNECTED ]]; then
LISTLENGHT=$((LISTLENGHT+1))
local connected="Connected to: $WIFICONNECTED\n"
local disclaimer=$connected
fi
# display warning only we have wifi
#if [[ " ${LIST[*]} " == *" Hotspot "* ]]; then
disclaimer=$disclaimer"\nNote: wireless networking in Linux is problematic. Our tools make it easy for some cases but can't enable AP on every random WiFi chip. If this tool fail, you are on your own.\n "
#else
# LISTLENGHT="$((6+${#LIST[@]}/2))"
#fi
DIALOG_CANCEL=1
DIALOG_ESC=255
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment