13 lines
No EOL
256 B
Bash
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
|
|
} |