two_with_bash/lib/numbers.sh
GnomeZworc 11eef332b7
add numbers gestion function
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-05-10 11:47:46 +02:00

13 lines
No EOL
254 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
}