Skip to content
Snippets Groups Projects
Commit ecaca570 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Now using mac address as an identifier in vanity section

parent d4eaeafc
No related branches found
No related tags found
No related merge requests found
...@@ -183,15 +183,19 @@ function nodedir ...@@ -183,15 +183,19 @@ function nodedir
# #
test -r "${BFANODEDIR}/netport" || test -r "${BFANODEDIR}/netport" ||
echo $(( $RANDOM / 2 + 12345 )) > ${BFANODEDIR}/netport echo $(( $RANDOM / 2 + 12345 )) > ${BFANODEDIR}/netport
netport=$( cat ${BFANODEDIR}/netport ) netport=$( cat ${BFANODEDIR}/netport )
test $? = 0 test $? = 0
test -r "${BFANODEDIR}/rpcport" || test -r "${BFANODEDIR}/rpcport" ||
echo $(( $RANDOM / 2 + 12345 )) > ${BFANODEDIR}/rpcport echo $(( $RANDOM / 2 + 12345 )) > ${BFANODEDIR}/rpcport
rpcport=$( cat ${BFANODEDIR}/rpcport ) rpcport=$( cat ${BFANODEDIR}/rpcport )
# something uniqueish # something uniqueish
local iphash=$( ip addr show scope global | awk '/^ *inet /{print $2}' | sed 's,/.*,,' | sha256sum ) ## find default interface
BFAEXTRADATA="${USER}@${HOSTNAME} ${iphash}" local def_if=$( ( ip -4 route show ; ip -6 route show ) | expand | sed -ne '/^default /{s/ */ /g;s/^.* dev //;s/ .*//;p;q}' )
BFAEXTRADATA="${BFAEXTRADATA:0:32}" local mymac=$( ip link show ${def_if} | sed -ne '/link\|ether/{s/^.*link.ether //;s/ .*//;s/://g;p;q}' )
BFAEXTRADATA="${USER}@${HOSTNAME}"
BFAEXTRADATA="${BFAEXTRADATA} "
BFAEXTRADATA="${BFAEXTRADATA:0:19} ${mymac}"
} }
function account function account
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment