Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Fixed register bug when mac_interface is not present #209

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openwisp-config/files/openwisp.agent
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ register() {
params keybase consistent_key exit_code message new prefix
hostname=$(uci get system.@system[0].hostname)
# use macaddr of interface specified in $MAC_INTERFACE
raw=$(ifconfig "$MAC_INTERFACE" 2>/dev/null 2>&1)
raw=$(ifconfig "$MAC_INTERFACE" 2>/dev/null)
# if previous command fails, fallback to first non-loopback interface
if [ -z "$raw" ]; then raw=$(ifconfig); fi
macaddr=$(echo "$raw " | grep -E -v "^(lo|tap[0-9]+)" | awk '/HWaddr/ { print $5 }' | head -n 1)
Expand Down
Loading