Skip to content

Commit

Permalink
oob: use mac-address without colons for hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
blocktrron committed Jul 27, 2024
1 parent 3d4cc90 commit 738d0ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openwrt/oob-packages/ffda-oob-firmware/files/uci-defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ cp /lib/ffda-oob-firmware/conffiles/config/* /etc/config/
# Get label-mac
LABEL_MAC="$(/lib/ffda-oob-firmware/label-mac.sh)"

# Remove colons
LABEL_MAC_NO_COLONS="$(echo $LABEL_MAC | tr -d ':')"

# Hash label-mac
LABEL_MAC_HASH="$(echo $LABEL_MAC | sha256sum | cut -c1-8)"

Expand All @@ -29,7 +32,7 @@ uci set ffda-oob-state-reporter.core.reporter_id="$HOST_ID"
uci commit ffda-oob-state-reporter

# Set default hostname
uci set system.@system[0].hostname="ffda-oob-$LABEL_MAC"
uci set system.@system[0].hostname="ffda-oob-$LABEL_MAC_NO_COLONS"

# Copy banner
cp /lib/ffda-oob-firmware/banner.txt /etc/banner
Expand Down

0 comments on commit 738d0ac

Please sign in to comment.