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

Few bugfixes

parent 28877e0d
...@@ -152,8 +152,8 @@ function jobs () ...@@ -152,8 +152,8 @@ function jobs ()
exit exit
elif [[ -n $CURRENT_UUID ]]; then elif [[ -n $CURRENT_UUID ]]; then
dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse \ dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse \
--yesno "\nAlready connected via wireless.\n\nDo you want to disconnect?" 9 57 --yesno "\nAlready connected to $WIFICONNECTED.\n\nDo you want to disconnect?" 9 57
[[ $? = 0 ]] && nmcli connection down uuid $CURRENT_UUID [[ $? = 0 ]] && nmcli connection down uuid $CURRENT_UUID > /dev/null 2>&1
else else
# disable AP mode on certain adapters # disable AP mode on certain adapters
wlan_exceptions "off" wlan_exceptions "off"
...@@ -183,11 +183,8 @@ function jobs () ...@@ -183,11 +183,8 @@ function jobs ()
elif [[ -n $CURRENT_UUID ]]; then elif [[ -n $CURRENT_UUID ]]; then
dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse \ dialog --title "Info" --backtitle "$BACKTITLE" --no-collapse \
--yesno "\nWireless connection is in use.\n\nDo you want to disconnect?" 9 57 --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 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 # change special adapters to AP mode
wlan_exceptions "on" wlan_exceptions "on"
# check for WLAN interfaces # check for WLAN interfaces
...@@ -304,7 +301,6 @@ function jobs () ...@@ -304,7 +301,6 @@ function jobs ()
reboot reboot
fi fi
fi fi
fi
;; ;;
...@@ -351,14 +347,17 @@ function jobs () ...@@ -351,14 +347,17 @@ function jobs ()
# Freeze and unfreeze kernel and board support packages # Freeze and unfreeze kernel and board support packages
# #
"Hold" | "Unhold" ) "Hold" | "Unhold" )
dialog --title "Update" --backtitle "$BACKTITLE" --yes-label "$selection" --no-label "Cancel" \ dialog --title "Update" --backtitle "$BACKTITLE" --yes-label "$1" --no-label "Cancel" \
--yesno "\nDo you want to ${selection,,} kernel updates?" 7 50 --yesno "\nDo you want to ${1,,} kernel updates?" 7 50
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
TARGET_BRANCH=$BRANCH TARGET_BRANCH=$BRANCH
exceptions "$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" 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" [[ $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 fi
;; ;;
......
...@@ -68,7 +68,6 @@ function get_ip_addresses() { ...@@ -68,7 +68,6 @@ function get_ip_addresses() {
DISTRO=$(lsb_release -is) DISTRO=$(lsb_release -is)
DISTROID=$(lsb_release -sc) DISTROID=$(lsb_release -sc)
KERNELID=$(uname -r) KERNELID=$(uname -r)
WIFICONNECTED=$(nmcli -f NAME connection show --active | tail -n +2 | tail -1)
BACKTITLE="Configuration utility, $ARMBIAN, https://www.armbian.com" BACKTITLE="Configuration utility, $ARMBIAN, https://www.armbian.com"
TITLE="$BOARD_NAME " TITLE="$BOARD_NAME "
IPADDRESS=$(get_ip_addresses) IPADDRESS=$(get_ip_addresses)
...@@ -339,7 +338,7 @@ while true; do ...@@ -339,7 +338,7 @@ while true; do
if [[ -n $(service hostapd status | grep -w active | grep -w running) ]]; then 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" ) [[ -n $(nmcli -f DEVICE,TYPE device status | grep wifi) ]] && LIST+=( "Hotspot" "Manage WiFi access point" )
else 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" ) [[ -n $(nmcli -f DEVICE,TYPE device status | grep wifi) ]] && LIST+=( "Hotspot" "Create WiFi access point" )
fi fi
[[ $(hcitool dev | sed '1d') != "" && -n $(service bluetooth status | grep -w active | grep -w running) ]] && LIST+=( "Bluetooth" "Connect Bluetooth devices" ) [[ $(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 ...@@ -348,14 +347,22 @@ while true; do
# count number of menu items to adjust window sizee # count number of menu items to adjust window sizee
LISTLENGHT="$((11+${#LIST[@]}/2))" LISTLENGHT="$((11+${#LIST[@]}/2))"
BOXLENGHT=${#LIST[@]} BOXLENGHT=${#LIST[@]}
WIFICONNECTED=$(nmcli -f NAME,TYPE connection show --active | grep wireless | awk 'NF{NF-=1};1')
# display warning only we have wifi disclaimer=""
if [[ " ${LIST[*]} " == *" Hotspot "* ]]; then if [[ -n $WIFICONNECTED ]]; 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 " LISTLENGHT=$((LISTLENGHT+1))
else local connected="Connected to: $WIFICONNECTED\n"
LISTLENGHT="$((6+${#LIST[@]}/2))" local disclaimer=$connected
fi 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_CANCEL=1
DIALOG_ESC=255 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