Skip to content

Commit

Permalink
dev-app:avahi: Do not hardcode network link
Browse files Browse the repository at this point in the history
Let the developer choose which interface to use in the soletta dev-app
recipe.

Signed-off-by: Flavio Ceolin <[email protected]>
  • Loading branch information
Flavio Ceolin committed Oct 23, 2016
1 parent d5f70c0 commit df53f7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#! /bin/bash
INTERFACE="enp2s0"
MAC_ADDRESS=`ifconfig $INTERFACE | grep "HWaddr" | awk '{print $NF}'`
MAC_ADDRESS=`ifconfig INTERFACE | grep "HWaddr" | awk '{print $NF}'`
sed -i "s@MACADDR@$MAC_ADDRESS@" /etc/avahi/services/soletta-dev-app.service
3 changes: 3 additions & 0 deletions recipes-soletta/dev-app/soletta-dev-app_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ FILES_${PN} += " \

SYSTEMD_SERVICE_${PN} = "soletta-dev-app-server.service soletta-dev-app-avahi-discover.service"

SOLETTA_DEVAPP_INTERFACE ?= "enp2s0"

do_install() {
install -d ${D}{INSTALLATION_PATH}
install -d ${D}${INSTALLATION_PATH}soletta-dev-app
Expand All @@ -58,4 +60,5 @@ do_install() {

#Install set MAC address script
install -m 0755 ${WORKDIR}/soletta-dev-app-mac.sh ${D}${INSTALLATION_PATH}soletta-dev-app/scripts/
sed -i -e 's/INTERFACE/${SOLETTA_DEVAPP_INTERFACE}/g' ${D}${INSTALLATION_PATH}soletta-dev-app/scripts/soletta-dev-app-mac.sh
}

0 comments on commit df53f7d

Please sign in to comment.