We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem is caused by fact that tr on empty string is ok (command return 0). So tr -d '-' || echo '0' behaves different then expected.
Proper order of commands below
The text was updated successfully, but these errors were encountered:
Hi @artur-fijalkowski,
Thanks for taking the time to dig in and identify a possible remedy.
PRs welcome :)
Sorry, something went wrong.
No branches or pull requests
Problem is caused by fact that tr on empty string is ok (command return 0). So tr -d '-' || echo '0' behaves different then expected.
Proper order of commands below
NB: This uses a combination of root partition UUID + network interface MAC address.
shell: ( (test -r /etc/fstab && ls -l /dev/disk/by-uuid/ | grep $(mount | grep ' / ' | cut -d' ' -f1 | cut -d'/' -f3) | grep --ignore-case --only-matching --extended-regexp --max 1 '[0-9a-f]{3,}[0-9a-f-]+' || echo '0') | tr -d '-' ; ifconfig | grep --ignore-case --only-matching --extended-regexp '([0-9a-f]{2}:){5}[0-9a-f]{2}' | tr -d ':' | tr -d '\n') | python -c 'import sys; x, y = sys.stdin.read().split(chr(10))[0:2]; x = int(x, 16); y = int(y, 16); sys.stdout.write((str(x + y)[-9:])); sys.exit(1 if x == 0 and y == 0 else 0)'register: machineidinteger
changed_when: False
when: kafka_generate_broker_id | bool
tags:
The text was updated successfully, but these errors were encountered: