From de58ef9089a3d104e73e122b9c1c005544e5e0ef Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 26 Dec 2008 08:35:23 +0000 Subject: Beginnings of a new TFTP package. --- packages/tftp/tftp_inc.tmp | 193 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 packages/tftp/tftp_inc.tmp (limited to 'packages/tftp/tftp_inc.tmp') diff --git a/packages/tftp/tftp_inc.tmp b/packages/tftp/tftp_inc.tmp new file mode 100644 index 00000000..20327fd9 --- /dev/null +++ b/packages/tftp/tftp_inc.tmp @@ -0,0 +1,193 @@ + "tftp.sh", + "start" => "/usr/sbin/inetd", + "stop" => "killall -9 /usr/sbin/inetd" + ) + ); + + + //sync_package_freeswitch(); + $handle = popen("/usr/sbin/inetd", "r"); + pclose($handle); + + //if (pkg_is_service_running('freeswitch')) { + // sync_package_freeswitch_ivr(); + //} + + //conf_mount_ro(); + //config_unlock(); + +} + + +function php_deinstall_command() +{ + + //prepare inetd.conf for tftp + $filename = "/etc/inetd.conf"; + $handle = fopen($filename,"rb"); + $contents = fread($handle, filesize($filename)); + 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); + fwrite($handle, $contents); + unset($contents); + fclose($fout); + unset($filename); + + exec("killall -9 /usr/sbin/inetd"); + + unlink_if_exists("/usr/local/pkg/tftp.xml"); + unlink_if_exists("/usr/local/pkg/tftp_inc.php"); + unlink_if_exists("/usr/local/www/tftp/tftp_files.php"); + + exec("rm -R /tftpboot"); + unlink_if_exists("/usr/local/etc/rc.d/tftp.sh"); + unlink_if_exists("/tmp/pkg_mgr_tftp.log"); + +} + +?> \ No newline at end of file -- cgit v1.2.3