#!/bin/sh

dir="/usr/lib/livecd-replace-localdomain.d"

for file in $(ls -1 "$dir" | sort -V | sort -f); do
    full_path="$dir/$file"
    if [ -f "$full_path" ]; then
        if [ -x "$full_path" ]; then
            if "$full_path"; then
                break
            fi
        fi
    fi
done

systemctl restart avahi-daemon
