22 lines
385 B
Bash
Executable File
22 lines
385 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ -z "${IDENTITY}" ]; then
|
|
echo "IDENTITY is missing." >&2
|
|
exit 1
|
|
fi
|
|
if [ -z "${NSID}" ]; then
|
|
echo "NSID is missing." >&2
|
|
exit 1
|
|
fi
|
|
|
|
{
|
|
ip -o addr | grep inet | grep -v ' scope link ' | sed -E 's|^.*inet6? ([0-9a-fA-F.:]+)/[0-9]{1,3} .*$|\tip-address: \1|g'
|
|
echo " identity: ${IDENTITY}"
|
|
echo " nsid: ${NSID}"
|
|
} > /etc/nsd/nsd.conf.d/addrs.conf
|
|
|
|
exec run.sh
|
|
|