two_with_bash/lib/numbers.sh
GnomeZworc 43eb9cc6b1
fix find mac
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-05-10 12:17:50 +02:00

13 lines
No EOL
256 B
Bash

#!/bin/bash
function generate_random_number {
local digits="$1"
tr -dc '0-9' </dev/urandom | head -c "$digits"
}
function find_mac {
id="${1}"
ip="${2}"
cat "/etc/dnsmasq.d/${id}.conf" | grep ",${ip}$" | cut -d, -f 1 | cut -d= -f2
}