Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
521f5336
Commit
521f5336
authored
Aug 30, 2017
by
Igor Pecovnik
Browse files
Various HT mode auto checking and bugfixes
parent
80969587
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian-config
View file @
521f5336
...
...
@@ -31,7 +31,7 @@ while true; do
exec
3>&1
selection
=
$(
dialog
--colors
--backtitle
"
$BACKTITLE
"
--title
" armbian-config "
--clear
\
--cancel-label
"Exit to shell"
--menu
"
\n
Configuration tool for the
\Z
5
${
BOARD_NAME
}
\Z
0 running
\Z
5
$DISTRO
$DISTROID
\Z
0
\n
"
$LISTLENGHT
70
$BOXLENGHT
\
--cancel-label
"Exit to shell"
--menu
"
\n
Configuration tool for the
\Z
1
${
BOARD_NAME
}
\Z
0 running
\Z
1
$DISTRO
$DISTROID
\Z
0
\n
"
$LISTLENGHT
70
$BOXLENGHT
\
"
${
LIST
[@]
}
"
2>&1 1>&3
)
exit_status
=
$?
exec
3>&-
...
...
debian-config-jobs
View file @
521f5336
...
...
@@ -229,6 +229,9 @@ function jobs ()
sed
'/### IEEE 802.11n/,/^### IEEE 802.11n/ s/^# *//'
-i
/etc/hostapd.conf
CHECK
=
$(
systemctl daemon-reload
;
service hostapd stop
;
sleep
2
;
service hostapd start
;
sleep
2
;
service hostapd status|grep fail
)
if
[[
-z
"
$CHECK
"
]]
;
then
# check various HT modes
check_ht_capab
# than go to check 5Ghz
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11a
\Z
1(5Ghz)
\Z
0"
5 36
sleep
2
sed
'/### IEEE 802.11a\>/,/^### IEEE 802.11a\>/ s/^# *//'
-i
/etc/hostapd.conf
...
...
@@ -240,7 +243,7 @@ function jobs ()
CHECK
=
$(
systemctl daemon-reload
;
service hostapd stop
;
sleep
2
;
service hostapd start
;
service hostapd status|grep fail
)
if
[[
-n
"
$CHECK
"
]]
;
then
dialog
--title
" Reverting configuration "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Wireless 802.11ac
\Z
1(433Mbps x n @ 5Ghz)
\Z
0 is not supported!"
5 60
sed
'/##
#
IEEE 802.11ac\>/,/^##
#
IEEE 802.11ac\>/ s/
^# */
/'
-i
/etc/hostapd.conf
sed
'/## IEEE 802.11ac\>/,/^## IEEE 802.11ac\>/ s/
.*/#&
/'
-i
/etc/hostapd.conf
fi
else
dialog
--title
" Reverting configuration "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Wireless 802.11a
\Z
1(5Ghz)
\Z
0 is not supported!"
5 45
...
...
@@ -685,6 +688,7 @@ function jobs ()
#
"Switch"
)
aval_kernel
[[
$exitstatus
=
1
]]
&&
break
exceptions
"
$INSTALL_KERNEL
"
dialog
--title
" Install and reboot "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"Cancel"
\
--yesno
"
\n
Switching to linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\n\n
Make sure you know what you are doing!
\
...
...
debian-config-submenu
View file @
521f5336
...
...
@@ -111,10 +111,24 @@ exec 3>&-
#
function
show_box
()
{
dialog
--no-shadow
--colors
--backtitle
"
$BACKTITLE
"
--no-collapse
--title
"
$1
"
--clear
--msgbox
"
\n
$2
\n
\n
"
$3
56
dialog
--colors
--backtitle
"
$BACKTITLE
"
--no-collapse
--title
"
$1
"
--clear
--msgbox
"
\n
$2
\n
\n
"
$3
56
}
function
check_ht_capab
()
{
declare
-a
arr
=(
"[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40][SMPS-STATIC]"
"[HT40-][SHORT-GI-40][SHORT-GI-40][DSSS_CCK-40]"
"[SHORT-GI-20][SHORT-GI-40][HT40+]"
)
for
i
in
"
${
arr
[@]
}
"
do
echo
"
$i
"
sed
-i
"s/^ht_capab=.*/ht_capab=
$i
/"
/etc/hostapd.conf
CHECK
=
$(
systemctl daemon-reload
;
service hostapd stop
;
sleep
2
;
service hostapd start
;
sleep
2
;
service hostapd status|grep fail
)
if
[[
-z
"
$CHECK
"
]]
;
then
break
;
fi
done
}
#-----------------------------------------------------------------------------------------------------------------------------------------#
#
# show description for MOTD files
...
...
@@ -260,8 +274,9 @@ function aval_kernel ()
TARGET_BRANCH
=
${
AVAL_KERNEL
[0]
}
else
exec
3>&1
TARGET_BRANCH
=
$(
dialog
--
no
cancel
--backtitle
"
$BACKTITLE
"
--no-collapse
\
TARGET_BRANCH
=
$(
dialog
--cancel
-label
"Back"
--backtitle
"
$BACKTITLE
"
--no-collapse
\
--title
"Upgrade from
$BRANCH
to:"
--clear
--menu
""
$((
6
+
${
LIST_LENGHT
}))
40 15
"
${
LIST
[@]
}
"
2>&1 1>&3
)
exitstatus
=
$?
;
exec
3>&-
fi
}
...
...
@@ -493,7 +508,7 @@ while true; do
if
[[
-n
$HOSTAPDINFO
&&
-n
$HOSTAPDSTATUS
]]
;
then
LISTLENGHT
=
$((
LISTLENGHT+2
))
disclaimer
=
$disclaimer
$"
\n\Z
0Hotspot SSID:
\Z
1
$HOSTAPDINFO
\Z
n Band:"
;
if
[[
`
grep
^
ieee80211
a /etc/hostapd.conf
`
]]
;
then
local
band
=
"5Ghz"
;
else
band
=
"2.4Ghz"
;
fi
if
[[
`
grep
^
hw_mode
=
a /etc/hostapd.conf
`
]]
;
then
local
band
=
"5Ghz"
;
else
band
=
"2.4Ghz"
;
fi
if
[[
`
grep
^ieee80211n /etc/hostapd.conf
`
]]
;
then
local type
=
"N"
;
fi
if
[[
`
grep
^ieee80211ac /etc/hostapd.conf
`
]]
;
then
local type
=
"AC"
;
fi
disclaimer
=
$disclaimer
$"
\Z
1
${
band
}
${
type
}
\Z
0 "
...
...
@@ -537,19 +552,24 @@ while true; do
LIST+
=(
"Hostname"
"Change your hostname
\Z
5(
$(
cat
/etc/hostname
)
)
\Z
0"
)
LIST+
=(
"Firmware"
"Upgrade board firmware"
)
# check for display manager statuses
# detect desktop
DISPLAY_MANAGER
=
""
;
DESKTOP_INSTALLED
=
""
if
[
$(
dpkg-query
-W
-f
=
'${db:Status-Abbrev}\n'
nodm 2>/dev/null
)
<
>
"*ii*"
]
;
then
DESKTOP_INSTALLED
=
"nodm"
;
fi
if
[
$(
dpkg-query
-W
-f
=
'${db:Status-Abbrev}\n'
lightdm 2>/dev/null
)
<
>
"*ii*"
]
;
then
DESKTOP_INSTALLED
=
"lightdm"
;
fi
[[
-n
$(
service lightdm status 2> /dev/null |
grep
-w
active
)
]]
&&
DISPLAY_MANAGER
=
"lightdm"
[[
-n
$(
service nodm status 2> /dev/null |
grep
-w
active
)
]]
&&
DISPLAY_MANAGER
=
"nodm"
[[
-d
/etc/lightdm
||
-f
/etc/default/nodm
]]
&&
DESKTOP_INSTALLED
=
"true"
if
[[
-n
$DISPLAY_MANAGER
]]
;
then
LIST+
=(
"Desktop"
"Disable desktop"
)
[[
$DISPLAY_MANAGER
==
'nodm'
]]
&&
LIST+
=(
"Lightdm"
"Switch to standard login manager"
)
[[
$DISPLAY_MANAGER
==
'lightdm'
]]
&&
LIST+
=(
"Nodm"
"Switch to simple auto login manager"
)
el
se
el
if
[[
-n
$DESKTOP_INSTALLED
]]
;
then
LIST+
=(
"Desktop"
"Enable desktop"
)
fi
if
[[
$DESKTOP_INSTALLED
]]
;
then
if
[[
-n
$DISPLAY_MANAGER
]]
;
then
if
[[
$(
service xrdp status 2> /dev/null |
grep
-w
active
)
]]
;
then
LIST+
=(
"RDP"
"Disable remote desktop access from Windows"
)
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment