Blame tests/p_tftp-server/0-install_tftp-server.sh

Athmane Madjoudj 81d17c
#!/bin/bash
Athmane Madjoudj 81d17c
# Author: Athmane Madjoudj <athmanem@gmail.com>
Athmane Madjoudj 81d17c
Athmane Madjoudj 81d17c
t_InstallPackage tftp-server xinetd tftp
Athmane Madjoudj 81d17c
Athmane Madjoudj 81d17c
# Enable tftp
Pablo Greco ee1fbf
if [ "$centos_ver" -ge "8" ] ; then
Pablo Greco ee1fbf
cat <<__EOF__ >/etc/xinetd.d/tftp
Pablo Greco ee1fbf
service tftp
Pablo Greco ee1fbf
{
Pablo Greco ee1fbf
    socket_type		= dgram
Pablo Greco ee1fbf
    protocol		= udp
Pablo Greco ee1fbf
    wait			= yes
Pablo Greco ee1fbf
    user			= root
Pablo Greco ee1fbf
    server			= /usr/sbin/in.tftpd
Pablo Greco ee1fbf
    server_args		= -s /var/lib/tftpboot
Pablo Greco ee1fbf
    disable			= no
Pablo Greco ee1fbf
    per_source		= 11
Pablo Greco ee1fbf
    cps			= 100 2
Pablo Greco ee1fbf
    flags			= IPv4
Pablo Greco ee1fbf
}
Pablo Greco ee1fbf
__EOF__
Pablo Greco ee1fbf
else
Athmane Madjoudj 81d17c
sed -i 's/\(disable\s*=\ \)yes/\1no/' /etc/xinetd.d/tftp
Pablo Greco ee1fbf
fi
Athmane Madjoudj 81d17c
Athmane Madjoudj c7aea7
t_ServiceControl xinetd restart