initial commit of file from CVS for smeserver-tftp-server on Sat Sep 7 21:08:06 AEST 2024
This commit is contained in:
3
root/etc/e-smith/templates/etc/hosts.allow/tftp
Normal file
3
root/etc/e-smith/templates/etc/hosts.allow/tftp
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
$DB->hosts_allow_spec('tftp', 'in.tftpd');
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
|
||||
[Unit]
|
||||
Description=Tftp Server
|
||||
Requires=tftp.socket
|
||||
Documentation=man:in.tftpd
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
@@ -0,0 +1,50 @@
|
||||
{
|
||||
my $blocksize = $tftp{blocksize} || "1468";
|
||||
my $verbosity = "-v";
|
||||
my $log = $tftp{log};
|
||||
my $refuse = $tftp{refuse};
|
||||
my $privilege = $tftp{privilege} || "";
|
||||
my $user = $tftp{user} || "";
|
||||
|
||||
# Now only relevant if you run under xinetd
|
||||
my $timeout = $tftp{timeout} || "";
|
||||
|
||||
if ( $log eq "verbose" ) {
|
||||
$verbosity = "-vv";
|
||||
}
|
||||
elsif ( $log eq "disabled" ) {
|
||||
$verbosity = "";
|
||||
}
|
||||
|
||||
if ( $refuse ne "" ) {
|
||||
$refuse = "-r $refuse";
|
||||
}
|
||||
|
||||
if ( $blocksize <= "512" ) {
|
||||
$blocksize = "512";
|
||||
}
|
||||
elsif ( $blocksize >= "65464" ) {
|
||||
$blocksize = "65464";
|
||||
}
|
||||
|
||||
if ( $privilege eq "rw" ) {
|
||||
$privilege = "-c";
|
||||
} elsif ($privilege = "ro" ) {
|
||||
$privilege = "";
|
||||
}
|
||||
|
||||
if ( $user ne "" ) {
|
||||
$user = "-u $user";
|
||||
}
|
||||
|
||||
$OUT .= "\n";
|
||||
$OUT .= "[Service]\n";
|
||||
$OUT .= "# Options: man in.tftpd\n";
|
||||
$OUT .= "# ExecStartPre=/bin/sleep 10\n";
|
||||
$OUT .= " \n";
|
||||
$OUT .= "ExecStart=\n";
|
||||
$OUT .= "ExecStart=/usr/sbin/in.tftpd -s /tftpboot $verbosity -B $blocksize $user $refuse $privilege\n";
|
||||
$OUT .= " \n";
|
||||
$OUT .= "StandardInput=socket\n";
|
||||
}
|
||||
|
@@ -0,0 +1,4 @@
|
||||
|
||||
[Install]
|
||||
WantedBy=sme-server.target
|
||||
Also=tftp.socket
|
@@ -0,0 +1,21 @@
|
||||
{
|
||||
|
||||
my $interfaceIP = "127.0.0.1";
|
||||
my $localIP = ${LocalIP};
|
||||
my $port = $tftp{UDPPort};
|
||||
my $access = $tftp{access};
|
||||
|
||||
if ( $access eq "public" ) {
|
||||
$interfaceIP = "0.0.0.0";
|
||||
}
|
||||
elsif ( $access eq "private" ) {
|
||||
$interfaceIP = $localIP;
|
||||
}
|
||||
|
||||
$OUT .= "[Socket]\n";
|
||||
$OUT .= "ListenDatagram=\n";
|
||||
$OUT .= "ListenDatagram=$interfaceIP:$port\n";
|
||||
$OUT .= "FreeBind=True\n";
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user