Nov 252016
 

A simple bash script to start/stop a TFTP server based on dnsmasq:

#/bin/bash
TFTPDIR=/tmp/tftpboot
INTERFACE=eth0
echo "Enabling TFTP on $INTERFACE in $TFTPDIR"
if [ ! -d $TFTPDIR ]; then
  mkdir -p $TFTPDIR;
fi
chmod 777 -R $TFTPDIR
dnsmasq --port=0 --enable-tftp --tftp-root=$TFTPDIR,$INTERFACE
read -p "Press any key to stop dnsmasq... " -n1
killall dnsmasq
exit 0

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)