Created
January 10, 2017 17:15
-
-
Save BlackLotus/e76c20cc77f46923c8d49615d757cbda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
log=/var/log/dnsmasq-pxe.log | |
image="/srv/tftp/images/initrd.img" | |
template=/srv/tftp/pxelinux.cfg/localboot | |
if [ "$1" == "old" ];then | |
echo "$3 $2" >> $log | |
elif [ "$1" == "tftp" ] && [ "$4" == "$image" ];then | |
filename=01-$(grep "^$3" $log|tail -n 1|awk {'print $2'}|sed 's/:/-/g') | |
install -o nobody -g nobody $template /srv/tftp/pxelinux.cfg/$filename | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment