[skip ci] set WIFI_PHY from _gen_config

master
Jordan Sokolic 2020-09-12 23:24:57 +03:00
parent 123e75d2f7
commit 58eb8b50b8
1 changed files with 3 additions and 0 deletions

3
run.sh
View File

@ -22,6 +22,8 @@ function _nmcli() {
}
function _get_phy_from_dev() {
test $WIFI_ENABLED = 'true' || return
test -z $WIFI_PHY || return
if [[ -f /sys/class/net/$WIFI_IFACE/phy80211/name ]]; then
WIFI_PHY=$(cat /sys/class/net/$WIFI_IFACE/phy80211/name 2>/dev/null)
echo "* got '$WIFI_PHY' for device '$WIFI_IFACE'"
@ -45,6 +47,7 @@ function _cleanup() {
function _gen_config() {
echo "* generating network config"
set -a
_get_phy_from_dev
source $CONFIG_FILE
for file in etc/config/*.tpl; do
envsubst <${file} >${file%.tpl}