From 9ba11c79e570b185bb598ed4d46823fb7ac5cfa5 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 27 Dec 2008 00:01:13 +0000 Subject: TFTP backup work and service show if service is active --- packages/tftp/tftp.inc | 6 ++-- packages/tftp/tftp.xml | 4 +-- packages/tftp/tftp_files.tmp | 70 +++++++++++++++++++++----------------------- 3 files changed, 38 insertions(+), 42 deletions(-) (limited to 'packages') diff --git a/packages/tftp/tftp.inc b/packages/tftp/tftp.inc index 0e86b400..61a41a58 100644 --- a/packages/tftp/tftp.inc +++ b/packages/tftp/tftp.inc @@ -144,12 +144,12 @@ function php_install_command() ); - //sync_package_freeswitch(); + //php_sync_package(); $handle = popen("/usr/sbin/inetd", "r"); pclose($handle); - //if (pkg_is_service_running('freeswitch')) { - // sync_package_freeswitch_ivr(); + //if (pkg_is_service_running('inetd')) { + // temp_sync_package(); //} //conf_mount_ro(); diff --git a/packages/tftp/tftp.xml b/packages/tftp/tftp.xml index eee6ddcc..51989fad 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.7.4 + 0.7.5 TFTP: Settings /usr/local/pkg/tftp.inc @@ -54,7 +54,7 @@ tftp tftp.sh - tftp + inetd Trivial File Transport Protocol is a very simple file transfer protocol. Often used with routers, voip phones and more. diff --git a/packages/tftp/tftp_files.tmp b/packages/tftp/tftp_files.tmp index 6491627c..750a1c72 100644 --- a/packages/tftp/tftp_files.tmp +++ b/packages/tftp/tftp_files.tmp @@ -5,8 +5,6 @@ Copyright (C) 2008 Mark J Crane All rights reserved. - FreeSWITCH (TM) - http://www.freeswitch.org/ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -34,22 +32,24 @@ require("guiconfig.inc"); require("/usr/local/pkg/tftp.inc"); if (($_GET['a'] == "download") && file_exists("/tftpboot/".$_GET['filename'])) { + + $filename = $_GET['filename']; if ($_GET['t'] == "backup") { $tmp = '/tmp/'; - $filename = 'freeswitch.bak.tgz'; - system('cd /usr/local/;tar cvzf /tmp/freeswitch.bak.tgz freeswitch'); + $filename = 'tftp.bak.tgz'; + system('cd /;tar cvzf /tmp/tftp.bak.tgz tftpboot'); } session_cache_limiter('public'); - $fd = fopen("/tftpboot/".$_GET['filename'], "rb"); + $fd = fopen("/tftpboot/".$filename, "rb"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); - header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"'); + header('Content-Disposition: attachment; filename="'.$filename.'"'); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past - header("Content-Length: " . filesize("/tftpboot/".$_GET['filename'])); + header("Content-Length: " . filesize("/tftpboot/".$filename)); fpassthru($fd); exit; } @@ -59,7 +59,7 @@ if ($_GET['a'] == "other") { $tmp = '/tmp/'; $filename = 'tftp.bak.tgz'; - //extract a specific directory to /usr/local/freeswitch + //extract a specific directory to /tftpboot if (file_exists('/tmp/'.$filename)) { //echo "The file $filename exists"; system('cd /tftpboot; tar xvpfz /tmp/'.$filename.' tftpboot/'); @@ -127,27 +127,45 @@ if ($savemsg) { Trivial File Transport Protocol is a very simple file transfer protocol. Use the file upload to add files to the /tftpboot directory. - Click on the file to download it. +


- +\n"; +echo "\n"; +echo "\n"; +echo "Backup / Restore
\n"; +echo "The 'backup' button will tar gzip /tftpboot/ to /tmp/tftp.bak.tgz it then presents a file to download. \n"; +echo "If the backup file does not exist in /tmp/tftp.bak.tgz then the 'restore' button will be hidden. \n"; +echo "Use Diagnostics->Command->File to upload: to browse to the file and then click on upload it now ready to be restored. \n"; +echo "

\n"; +echo "\n"; +echo "\n"; +echo " \n"; +if (file_exists('/tmp/tftp.bak.tgz')) { + echo " \n"; +} +echo "\n"; +echo "\n"; +echo "\n"; +echo "

\n\n"; +?>
- + + + \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
File to upload: - -
    @@ -209,28 +227,6 @@ if ($savemsg) {

- -\n"; -echo "
\n"; -echo "Backup / Restore
\n"; -echo "The 'backup' button will tar gzip /tftpboot/ to /tmp/tftp.bak.tgz it then presents a file to download. \n"; -echo "If the backup file does not exist in /tmp/tftp.bak.tgz then the 'restore' button will be hidden. \n"; -echo "Use Diagnostics->Command->File to upload: to browse to the file and then click on upload it now ready to be restored. \n"; -echo "

\n"; -echo "
\n"; -echo " \n"; -if (file_exists('/tmp/tftp.bak.tgz')) { - echo " \n"; -} -echo "
\n"; -echo "

\n\n"; -?> -


-- cgit v1.2.3