From 68e96fbf345846169ffeed749641ad0f4a2ab5eb Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 26 Dec 2008 20:00:08 +0000 Subject: TFTP package add file upload to the tftpboot directory. --- packages/tftp/tftp.inc | 6 +++--- packages/tftp/tftp.xml | 2 +- packages/tftp/tftp_files.tmp | 37 +++++++++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/tftp/tftp.inc b/packages/tftp/tftp.inc index e487247d..deed9c48 100644 --- a/packages/tftp/tftp.inc +++ b/packages/tftp/tftp.inc @@ -118,7 +118,7 @@ function php_install_command() fclose($handle); $handle = fopen($filename,"w"); - $contents = str_replace("#tftp dgram udp wait root /usr/libexec/tftpd", "tftp dgram udp wait root /usr/libexec/tftpd", $contents); + $contents = str_replace("\#tftp dgram udp wait root /usr/libexec/tftpd", "tftp dgram udp wait root /usr/libexec/tftpd", $contents); fwrite($handle, $contents); unset($contents); fclose($handle); @@ -140,7 +140,7 @@ function php_install_command() write_rcfile(array( "file" => "tftp.sh", - "start" => "/usr/sbin/inetd", + "start" => "/usr/sbin/./inetd", "stop" => "killall -9 /usr/sbin/inetd" ) ); @@ -170,7 +170,7 @@ function php_deinstall_command() fclose($handle); $handle = fopen($filename,"w"); - $contents = str_replace("tftp dgram udp wait root /usr/libexec/tftpd", "#tftp dgram udp wait root /usr/libexec/tftpd", $contents); + $contents = str_replace("tftp dgram udp wait root /usr/libexec/tftpd", "\#tftp dgram udp wait root /usr/libexec/tftpd", $contents); fwrite($handle, $contents); unset($contents); fclose($fout); diff --git a/packages/tftp/tftp.xml b/packages/tftp/tftp.xml index 9e3fee45..812789e6 100644 --- a/packages/tftp/tftp.xml +++ b/packages/tftp/tftp.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. tftp Settings - 0.6 + 0.7 TFTP: Settings /usr/local/pkg/tftp.inc diff --git a/packages/tftp/tftp_files.tmp b/packages/tftp/tftp_files.tmp index cd74bd62..d79d39a2 100644 --- a/packages/tftp/tftp_files.tmp +++ b/packages/tftp/tftp_files.tmp @@ -48,6 +48,12 @@ if (($_GET['a'] == "download") && file_exists("/tftpboot/".$_GET['filename'])) { exit; } +if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { + move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tftpboot/" . $_FILES['ulfile']['name']); + $ulmsg = "Uploaded file to /tftpboot/" . htmlentities($_FILES['ulfile']['name']); + unset($_POST['txtCommand']); +} + if ($_GET['act'] == "del") { if ($_GET['type'] == 'ivr') { @@ -87,8 +93,6 @@ include("head.inc"); -
-

TFTP files
@@ -99,6 +103,32 @@ include("head.inc");


+ + +
+ + + + + + + + + + + + + + +
Upload
File to upload: + +
    +
+
+
+ + +
@@ -145,7 +175,7 @@ include("head.inc"); ?> - +
@@ -179,7 +209,6 @@ include("head.inc"); - -- cgit v1.2.3