#!/bin/sh bmx6hosts > /tmp/bmx6hosts.new md5new="$(md5sum /tmp/bmx6hosts.new | awk '{print $1}')" md5last="$(cat /tmp/bmx6hosts.last.md5)" [ "$md5new" != "$md5last" ] && { logger -t bmx6hosts "New bmx6 hosts found, updating dnsmasq" mv /tmp/bmx6hosts.new /var/hosts/bmx6 killall -HUP dnsmasq } echo "$md5new" > /tmp/bmx6hosts.last.md5