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
bcb2a070
Commit
bcb2a070
authored
Aug 28, 2017
by
Igor Pecovnik
Browse files
Fixing hostapd autodetedtion and small fixes
parent
d43f68b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
bcb2a070
# Armbian config
# Armbian config
uration utility
Utility for configuring your board and install various services.
Utility for configuring your board, adjust services and install applications. It comes with Armbian by default. Login and type:
It comes with Armbian (from 5.27) by default. Login as super user and type:
armbian-config
armbian-config
...
...
debian-config-jobs
View file @
bcb2a070
...
@@ -147,6 +147,18 @@ function jobs ()
...
@@ -147,6 +147,18 @@ function jobs ()
nmtui-connect
nmtui-connect
;;
;;
# Connect to wireless access point
#
"Clear"
)
# remove managed interfaces
systemctl daemon-reload
rm
/etc/NetworkManager/conf.d/armbian.conf
rm
-f
/etc/network/interfaces.d/armbian.ap.nat
rm
-f
/etc/network/interfaces.d/armbian.ap.bridge
reload-nety
;;
# Create WiFi access point
# Create WiFi access point
#
#
"Hotspot"
)
"Hotspot"
)
...
@@ -206,29 +218,37 @@ function jobs ()
...
@@ -206,29 +218,37 @@ function jobs ()
echo
"ctrl_interface=/var/run/hostapd"
>>
/etc/hostapd.conf
echo
"ctrl_interface=/var/run/hostapd"
>>
/etc/hostapd.conf
echo
"ctrl_interface_group=0"
>>
/etc/hostapd.conf
echo
"ctrl_interface_group=0"
>>
/etc/hostapd.conf
fi
fi
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
re
start
;
service hostapd status|grep
running
)
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
stop
;
sleep
2
;
service hostapd
start
;
service hostapd status|grep
fail
)
# check n,a and ac modes
# check n,a and ac modes
if
[[
-
n
"
$CHECK
"
]]
;
then
if
[[
-
z
"
$CHECK
"
]]
;
then
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11n
\Z
1(150-300Mbps)
\Z
0"
5 43
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11n
\Z
1(150-300Mbps)
\Z
0"
5 43
sleep
2
sleep
2
sed
'/### IEEE 802.11n/,/^### IEEE 802.11n/ s/^# *//'
-i
/etc/hostapd.conf
sed
'/### IEEE 802.11n/,/^### IEEE 802.11n/ s/^# *//'
-i
/etc/hostapd.conf
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
re
start
;
service hostapd status|grep
running
)
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
stop
;
sleep
2
;
service hostapd
start
;
service hostapd status|grep
fail
)
if
[[
-
n
"
$CHECK
"
]]
;
then
if
[[
-
z
"
$CHECK
"
]]
;
then
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11a
\Z
1(5Ghz)
\Z
0"
5 36
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11a
\Z
1(5Ghz)
\Z
0"
5 36
sleep
2
sleep
2
sed
'/### IEEE 802.11a/,/^### IEEE 802.11a/ s/^# *//'
-i
/etc/hostapd.conf
sed
'/### IEEE 802.11a
\>
/,/^### IEEE 802.11a
\>
/ s/^# *//'
-i
/etc/hostapd.conf
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
re
start
;
service hostapd status|grep
running
)
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
stop
;
sleep
2
;
service hostapd
start
;
service hostapd status|grep
fail
)
if
[[
-
n
"
$CHECK
"
]]
;
then
if
[[
-
z
"
$CHECK
"
]]
;
then
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11ac
\Z
1(433Mbps x n @ 5Ghz)
\Z
0"
5 51
dialog
--title
" Info "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Probing wireless 802.11ac
\Z
1(433Mbps x n @ 5Ghz)
\Z
0"
5 51
sleep
2
sleep
2
sed
'/### IEEE 802.11ac\>/,/^### IEEE 802.11ac\>/ s/^# *//'
-i
/etc/hostapd.conf
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
fi
else
else
sed
'/## IEEE 802.11a/,/^## IEEE 802.11a/ s/.*/#&/'
-i
/etc/hostapd.conf
dialog
--title
" Reverting configuration "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Wireless 802.11a
\Z
1(5Ghz)
\Z
0 is not supported!"
5 45
sed
'/## IEEE 802.11a\>/,/^## IEEE 802.11a\>/ s/.*/#&/'
-i
/etc/hostapd.conf
fi
fi
else
else
dialog
--title
" Reverting configuration "
--backtitle
"
$BACKTITLE
"
--no-collapse
--colors
--infobox
"
\n
Wireless 802.11n
\Z
1(150-300Mbps)
\Z
0 is not supported!"
5 52
sed
'/## IEEE 802.11n/,/^## IEEE 802.11n/ s/.*/#&/'
-i
/etc/hostapd.conf
sed
'/## IEEE 802.11n/,/^## IEEE 802.11n/ s/.*/#&/'
-i
/etc/hostapd.conf
fi
fi
fi
fi
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
re
start
;
service hostapd status|grep fail
)
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
stop
;
sleep
2
;
service hostapd
start
;
service hostapd status|grep fail
)
if
[[
-n
"
$CHECK
"
]]
;
then
if
[[
-n
"
$CHECK
"
]]
;
then
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
\
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
\
--infobox
"
\n
Wireless adapter:
$WIRELESS_ADAPTER
\n\n
Probing Realtek hostapd driver compatibility."
7 50
--infobox
"
\n
Wireless adapter:
$WIRELESS_ADAPTER
\n\n
Probing Realtek hostapd driver compatibility."
7 50
...
@@ -241,12 +261,14 @@ function jobs ()
...
@@ -241,12 +261,14 @@ function jobs ()
echo
"ctrl_interface=/var/run/hostapd"
>>
/etc/hostapd.conf
echo
"ctrl_interface=/var/run/hostapd"
>>
/etc/hostapd.conf
echo
"ctrl_interface_group=0"
>>
/etc/hostapd.conf
echo
"ctrl_interface_group=0"
>>
/etc/hostapd.conf
fi
fi
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
re
start
;
service hostapd status|grep fail
)
CHECK
=
$(
systemctl daemon-reload
;
service hostapd
stop
;
sleep
2
;
service hostapd
start
;
service hostapd status|grep fail
)
# if both fails there is other problem
# if both fails there is other problem
if
[[
-n
"
$CHECK
"
]]
;
then
if
[[
-n
"
$CHECK
"
]]
;
then
dialog
--backtitle
"
$BACKTITLE
"
--title
"Warning"
\
dialog
--backtitle
"
$BACKTITLE
"
--title
"Warning"
\
--infobox
"
\n
Wireless adapter:
$WIRELESS_ADAPTER
\n\n
No compatible hostapd driver found."
7 39
--infobox
"
\n
Wireless adapter:
$WIRELESS_ADAPTER
\n\n
No compatible hostapd driver found."
7 39
sed
-i
"s/^DAEMON_CONF=.*/DAEMON_CONF=/"
/etc/init.d/hostapd
sed
-i
"s/^DAEMON_CONF=.*/DAEMON_CONF=/"
/etc/init.d/hostapd
# remove interfaces from managed list
rm
-f
/etc/NetworkManager/conf.d/armbian.conf
systemctl daemon-reload
;
service hostapd restart
systemctl daemon-reload
;
service hostapd restart
sleep
3
sleep
3
break
break
...
@@ -279,12 +301,9 @@ function jobs ()
...
@@ -279,12 +301,9 @@ function jobs ()
# NAT
# NAT
0
)
0
)
TEMP_CONF
=
"/etc/network/interfaces.d/armbian.ap.nat"
TEMP_CONF
=
"/etc/network/interfaces.d/armbian.ap.nat"
if
[[
$(
dpkg-query
-W
-f
=
'${db:Status-Abbrev}\n'
dnsmasq 2>/dev/null
)
!=
*
ii
*
]]
;
then
if
[[
$(
dpkg-query
-W
-f
=
'${db:Status-Abbrev}\n'
dnsmasq 2>/dev/null
)
!=
*
ii
*
]]
;
then
debconf-apt-progress
--
apt-get
-qq
-y
--no-install-recommends
install
dnsmasq
;
fi
debconf-apt-progress
--
apt-get
-qq
-y
--no-install-recommends
install
dnsmasq
if
[[
$(
dpkg-query
-W
-f
=
'${db:Status-Abbrev}\n'
iptables 2>/dev/null
)
!=
*
ii
*
]]
;
then
debconf-apt-progress
--
apt-get
-qq
-y
--no-install-recommends
install
iptables
;
fi
fi
if
[[
$(
dpkg-query
-W
-f
=
'${db:Status-Abbrev}\n'
iptables 2>/dev/null
)
!=
*
ii
*
]]
;
then
debconf-apt-progress
--
apt-get
-qq
-y
--no-install-recommends
install
iptables
fi
echo
-e
"# armbian NAT hostapd
\n
allow-hotplug
$WIRELESS_ADAPTER
\n
iface
$WIRELESS_ADAPTER
inet static "
>
$TEMP_CONF
echo
-e
"# armbian NAT hostapd
\n
allow-hotplug
$WIRELESS_ADAPTER
\n
iface
$WIRELESS_ADAPTER
inet static "
>
$TEMP_CONF
echo
-e
"
\t
address 172.24.1.1
\n\t
netmask 255.255.255.0
\n\t
network 172.24.1.0
\n\t
broadcast 172.24.1.255"
>>
$TEMP_CONF
echo
-e
"
\t
address 172.24.1.1
\n\t
netmask 255.255.255.0
\n\t
network 172.24.1.0
\n\t
broadcast 172.24.1.255"
>>
$TEMP_CONF
# create new configuration
# create new configuration
...
...
debian-config-submenu
View file @
bcb2a070
...
@@ -59,6 +59,7 @@ function create_if_config() {
...
@@ -59,6 +59,7 @@ function create_if_config() {
}
#
}
#
function
reload-nety
()
{
function
reload-nety
()
{
systemctl daemon-reload
if
[[
"
$1
"
==
"reload"
]]
;
then
WHATODO
=
"Reloading services"
;
else
WHATODO
=
"Stopping services"
;
fi
if
[[
"
$1
"
==
"reload"
]]
;
then
WHATODO
=
"Reloading services"
;
else
WHATODO
=
"Stopping services"
;
fi
(
service network-manager stop
;
echo
10
;
sleep
1
;
\
(
service network-manager stop
;
echo
10
;
sleep
1
;
\
service hostapd stop
;
echo
20
;
sleep
1
;
\
service hostapd stop
;
echo
20
;
sleep
1
;
\
...
@@ -423,7 +424,12 @@ while true; do
...
@@ -423,7 +424,12 @@ while true; do
[[
-n
$(
nmcli device status |
grep
wifi |
grep
-w
disconnected
)
]]
&&
LIST+
=(
"Hotspot"
"Create WiFi access point"
)
[[
-n
$(
nmcli device status |
grep
wifi |
grep
-w
disconnected
)
]]
&&
LIST+
=(
"Hotspot"
"Create WiFi access point"
)
fi
fi
[[
-n
$(
nmcli device status |
grep
wifi |
grep
-v
unavailable |
grep
-v
unmanaged
)
]]
&&
LIST+
=(
"WiFi"
"Manage wireless networking"
)
if
[[
-n
$(
nmcli device status |
grep
wifi |
grep
-v
unavailable |
grep
-v
unmanaged
)
]]
;
then
LIST+
=(
"WiFi"
"Manage wireless networking"
)
else
LIST+
=(
"Clear"
"Clear possible blocked interfaces"
)
fi
if
[[
-n
$(
service bluetooth status |
grep
-w
active |
grep
-w
running
)
]]
;
then
if
[[
-n
$(
service bluetooth status |
grep
-w
active |
grep
-w
running
)
]]
;
then
[[
$(
hcitool dev |
sed
'1d'
)
!=
""
]]
&&
LIST+
=(
"Bluetooth"
"Connect Bluetooth devices"
)
[[
$(
hcitool dev |
sed
'1d'
)
!=
""
]]
&&
LIST+
=(
"Bluetooth"
"Connect Bluetooth devices"
)
...
...
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