Add the following line in /etc/dnsmasq.conf dhcp-script=/etc/detect_new_device.sh Setup sendmail to send email to your text number. Reference: https://wiki.openwrt.org/doc/howto/smtp.client