All pastes #561132 Raw Edit

Something

public text v1 · immutable
·published 2007-06-12 10:56 UTC
rendered paste body
###########################################################
#
# oxyl
#
###########################################################

# You must replace "oxyl" and "OXYL" with the lower case name and
# upper case name of your new package.  Some places below will say
# "Do not change this" - that does not include this global change,
# which must always be done to ensure we have unique names.

#
# OXYL_VERSION, OXYL_SITE and OXYL_SOURCE define
# the upstream location of the source code for the package.
# OXYL_DIR is the directory which is created when the source
# archive is unpacked.
# OXYL_UNZIP is the command used to unzip the source.
# It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
#
# You should change all these variables to suit your package.
# Please make sure that you add a description, and that you
# list all your packages' dependencies, seperated by commas.
# 
# If you list yourself as MAINTAINER, please give a valid email
# address, and indicate your irc nick if it cannot be easily deduced
# from your name or email address.  If you leave MAINTAINER set to
# "NSLU2 Linux" other developers will feel free to edit.
#
OXYL_SITE=http://www.oxyl.de
OXYL_VERSION=2.5.36
OXYL_SOURCE=oxyl-$(OXYL_VERSION).tar.gz
OXYL_DIR=oxyl
OXYL_UNZIP=zcat
OXYL_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
OXYL_DESCRIPTION=Oxyl is a Mediaplayer for Pinnacle Showcenter and other Syabas Clients
OXYL_SECTION=Multimedia
OXYL_PRIORITY=optional
OXYL_DEPENDS=php, php-gd, php-fcgi, lighhtpd
OXYL_SUGGESTS=
OXYL_CONFLICTS=

#
# OXYL_IPK_VERSION should be incremented when the ipk changes.
#
OXYL_IPK_VERSION=1

#
# OXYL_CONFFILES should be a list of user-editable files
OXYL_CONFFILES=/opt/etc/lighttpd/lighttpd.conf 

#
# OXYL_PATCHES should list any patches, in the the order in
# which they should be applied to the source code.
#
OXYL_PATCHES=$(OXYL_SOURCE_DIR)/functions.inc.patch \
	$(OXYL_SOURCE_DIR)/oxyl_box_check.php.patch 
#
# If the compilation of the package requires additional
# compilation or linking flags, then list them here.
#
OXYL_CPPFLAGS=
OXYL_LDFLAGS=

#
# OXYL_BUILD_DIR is the directory in which the build is done.
# OXYL_SOURCE_DIR is the directory which holds all the
# patches and ipkg control files.
# OXYL_IPK_DIR is the directory in which the ipk is built.
# OXYL_IPK is the name of the resulting ipk files.
#
# You should not change any of these variables.
#
OXYL_BUILD_DIR=$(BUILD_DIR)/oxyl
OXYL_SOURCE_DIR=$(SOURCE_DIR)/oxyl
OXYL_IPK_DIR=$(BUILD_DIR)/oxyl-$(OXYL_VERSION)-ipk
OXYL_IPK=$(BUILD_DIR)/oxyl_$(OXYL_VERSION)-$(OXYL_IPK_VERSION)_$(TARGET_ARCH).ipk

.PHONY: oxyl-source oxyl-unpack oxyl oxyl-stage oxyl-ipk oxyl-clean oxyl-dirclean oxyl-check

#
# This is the dependency on the source code.  If the source is missing,
# then it will be fetched from the site using wget.
#
$(DL_DIR)/$(OXYL_SOURCE):
	$(WGET) -P $(DL_DIR) $(OXYL_SITE)/$(OXYL_SOURCE) || \
	$(WGET) -P $(DL_DIR) $(SOURCES_NLO_SITE)/$(OXYL_SOURCE)

#
# The source code depends on it existing within the download directory.
# This target will be called by the top level Makefile to download the
# source code's archive (.tar.gz, .bz2, etc.)
#
oxyl-source: $(DL_DIR)/$(OXYL_SOURCE) $(OXYL_PATCHES)

#
# This target unpacks the source code in the build directory.
# If the source archive is not .tar.gz or .tar.bz2, then you will need
# to change the commands here.  Patches to the source code are also
# applied in this target as required.
#
# This target also configures the build within the build directory.
# Flags such as LDFLAGS and CPPFLAGS should be passed into configure
# and NOT $(MAKE) below.  Passing it to configure causes configure to
# correctly BUILD the Makefile with the right paths, where passing it
# to Make causes it to override the default search paths of the compiler.
#
# If the compilation of the package requires other packages to be staged
# first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
#
# If the package uses  GNU libtool, you should invoke $(PATCH_LIBTOOL) as
# shown below to make various patches to it.
#
$(OXYL_BUILD_DIR)/.configured: $(DL_DIR)/$(OXYL_SOURCE) $(OXYL_PATCHES)
#	$(MAKE) <bar>-stage <baz>-stage
	rm -rf $(BUILD_DIR)/$(OXYL_DIR) $(OXYL_BUILD_DIR)
	$(OXYL_UNZIP) $(DL_DIR)/$(OXYL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
	if test -n "$(OXYL_PATCHES)" ; \
		then cat $(OXYL_PATCHES) | \
		patch -d $(BUILD_DIR)/$(OXYL_DIR) -p0 ; \
	fi
	if test "$(BUILD_DIR)/$(OXYL_DIR)" != "$(OXYL_BUILD_DIR)" ; \
	mv $(BUILD_DIR)/$(OXYL_DIR) $(OXYL_BUILD_DIR) ; \
	fi
#	(cd $(OXYL_BUILD_DIR); \
#		$(TARGET_CONFIGURE_OPTS) \
#		CPPFLAGS="$(STAGING_CPPFLAGS) $(OXYL_CPPFLAGS)" \
#		LDFLAGS="$(STAGING_LDFLAGS) $(OXYL_LDFLAGS)" \
#		./configure \
#		--build=$(GNU_HOST_NAME) \
#		--host=$(GNU_TARGET_NAME) \
#		--target=$(GNU_TARGET_NAME) \
#		--prefix=/opt \
#		--disable-nls \
#		--disable-static \
#	)
#	$(PATCH_LIBTOOL) $(OXYL_BUILD_DIR)/libtool
	touch $@
#	touch $(OXYL_BUILD_DIR)/.configured

oxyl-unpack: $(OXYL_BUILD_DIR)/.configured

#
# This builds the actual binary.
#
#$(OXYL_BUILD_DIR)/.built: $(OXYL_BUILD_DIR)/.configured
#	rm -f $@
#	$(MAKE) -C $(OXYL_BUILD_DIR)
#	touch $@

#
# This is the build convenience target.
#
oxyl: $(OXYL_BUILD_DIR)/.configured

#
# If you are building a library, then you need to stage it too.
#
#$(OXYL_BUILD_DIR)/.staged: $(OXYL_BUILD_DIR)/.built
#	rm -f $@
#	$(MAKE) -C $(OXYL_BUILD_DIR) DESTDIR=$(STAGING_DIR) install
#	touch $@

#oxyl-stage: $(OXYL_BUILD_DIR)/.staged

#
# This rule creates a control file for ipkg.  It is no longer
# necessary to create a seperate control file under sources/oxyl
#
$(OXYL_IPK_DIR)/CONTROL/control:
	@install -d $(@D)
	@rm -f $@
	@echo "Package: oxyl" >>$@
	@echo "Architecture: $(TARGET_ARCH)" >>$@
	@echo "Priority: $(OXYL_PRIORITY)" >>$@
	@echo "Section: $(OXYL_SECTION)" >>$@
	@echo "Version: $(OXYL_VERSION)-$(OXYL_IPK_VERSION)" >>$@
	@echo "Maintainer: $(OXYL_MAINTAINER)" >>$@
	@echo "Source: $(OXYL_SITE)/$(OXYL_SOURCE)" >>$@
	@echo "Description: $(OXYL_DESCRIPTION)" >>$@
	@echo "Depends: $(OXYL_DEPENDS)" >>$@
	@echo "Suggests: $(OXYL_SUGGESTS)" >>$@
	@echo "Conflicts: $(OXYL_CONFLICTS)" >>$@

#
# This builds the IPK file.
#
# Binaries should be installed into $(OXYL_IPK_DIR)/opt/sbin or $(OXYL_IPK_DIR)/opt/bin
# (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
# Libraries and include files should be installed into $(OXYL_IPK_DIR)/opt/{lib,include}
# Configuration files should be installed in $(OXYL_IPK_DIR)/opt/etc/oxyl/...
# Documentation files should be installed in $(OXYL_IPK_DIR)/opt/doc/oxyl/...
# Daemon startup scripts should be installed in $(OXYL_IPK_DIR)/opt/etc/init.d/S??oxyl
#
# You may need to patch your application to make it use these locations.
#
$(OXYL_IPK): $(OXYL_BUILD_DIR)/.configured
	rm -rf $(OXYL_IPK_DIR) $(BUILD_DIR)/oxyl_*_$(TARGET_ARCH).ipk
#	$(MAKE) -C $(OXYL_BUILD_DIR) DESTDIR=$(OXYL_IPK_DIR) install-strip
	install -d $(OXYL_IPK_DIR)/opt/share/www/oxyl
	cp -a $(OXYL_BUILD_DIR)/* $(OXYL_IPK_DIR)/opt/share/www/oxyl
	install -d $(OXYL_IPK_DIR)/opt/etc/lighttpd
	install -m 644 $(OXYL_SOURCE_DIR)/lighttpd.conf $(OXYL_IPK_DIR)/opt/etc/lighttpd/lighttpd.conf
	install -m 644 $(OXYL_SOURCE_DIR)/lighttpd.conf.oxyl $(OXYL_IPK_DIR)/opt/etc/lighttpd/lighttpd.conf.oxyl
	install -d $(OXYL_IPK_DIR)/opt/var/log/lighttpd
	install -m 755 $(OXYL_SOURCE_DIR)/error.log $(OXYL_IPK_DIR)/opt/var/log/lighttpd/error.log
#	sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(OXYL_IPK_DIR)/opt/etc/init.d/SXXoxyl
	$(MAKE) $(OXYL_IPK_DIR)/CONTROL/control
	install -m 755 $(OXYL_SOURCE_DIR)/postinst $(OXYL_IPK_DIR)/CONTROL/postinst
	sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(OXYL_IPK_DIR)/CONTROL/postinst
#	install -m 755 $(OXYL_SOURCE_DIR)/prerm $(OXYL_IPK_DIR)/CONTROL/prerm
#	sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(OXYL_IPK_DIR)/CONTROL/prerm
	echo $(OXYL_CONFFILES) | sed -e 's/ /\n/g' > $(OXYL_IPK_DIR)/CONTROL/conffiles
	cd $(BUILD_DIR); $(IPKG_BUILD) $(OXYL_IPK_DIR)

#
# This is called from the top level makefile to create the IPK file.
#
oxyl-ipk: $(OXYL_IPK)

#
# This is called from the top level makefile to clean all of the built files.
#
oxyl-clean:
	rm -f $(OXYL_BUILD_DIR)/.built
	-$(MAKE) -C $(OXYL_BUILD_DIR) clean

#
# This is called from the top level makefile to clean all dynamically created
# directories.
#
oxyl-dirclean:
	rm -rf $(BUILD_DIR)/$(OXYL_DIR) $(OXYL_BUILD_DIR) $(OXYL_IPK_DIR) $(OXYL_IPK)
#
#
# Some sanity check for the package.
#
oxyl-check: $(OXYL_IPK)
	perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(OXYL_IPK)

the output from make oxyl

if test -n "/home/heinz/devel/optware/sources/oxyl/functions.inc.patch /home/heinz/devel/optware/sources/oxyl/oxyl_box_check.php.patch " ; \
        then cat /home/heinz/devel/optware/sources/oxyl/functions.inc.patch /home/heinz/devel/optware/sources/oxyl/oxyl_box_check.php.patch  | \
        patch -d /home/heinz/devel/optware/builds/oxyl -p0 ; \
fi
patching file common/functions.inc
Hunk #1 FAILED at 708.
Hunk #2 FAILED at 741.
Hunk #3 FAILED at 1825.
Hunk #4 FAILED at 1892.
Hunk #5 FAILED at 1933.
Hunk #6 FAILED at 1951.
Hunk #7 FAILED at 1966.
7 out of 7 hunks FAILED -- saving rejects to file common/functions.inc.rej
patching file common/oxyl_box_check.php
Hunk #1 FAILED at 68.
1 out of 1 hunk FAILED -- saving rejects to file common/oxyl_box_check.php.rej
make: *** [/home/heinz/devel/optware/builds/oxyl/.configured] Fehler 1


oxyl_box_check.php.patch :

--- common/oxyl_box_check.php.org	2007-06-10 21:11:40.000000000 +0200
+++ common/oxyl_box_check.php	2007-06-09 07:20:20.000000000 +0200
@@ -68,8 +68,8 @@
 echo '<td><img src="'.(defined('OXYLBOX_VERSION') ? $io : $nio).'"></td></tr>';
 
 //apache version
-$apache_check = stristr($_SERVER["SERVER_SOFTWARE"],'apache/2')!== FALSE ? 1 : 0;
-echo '<tr><td><font size=2>Apache Version:&nbsp;</font></td>';
+$apache_check = stristr($_SERVER["SERVER_SOFTWARE"],'lighttpd')!== FALSE ? 1 : 0;
+echo '<tr><td><font size=2>Server Version:&nbsp;</font></td>';
 echo '<td><font size=2>'.$_SERVER["SERVER_SOFTWARE"].($apache_check ? '' : '&nbsp;&nbsp;< Apache/2.0 !').'</font></td>';
 echo '<td><img src="'.($apache_check ? $io : $nio).'"></td></tr>';
 


oxyl_box_check.php.rej :

***************
*** 68,75 ****
  echo '<td><img src="'.(defined('OXYLBOX_VERSION') ? $io : $nio).'"></td></tr>';
  
  //apache version
- $apache_check = stristr($_SERVER["SERVER_SOFTWARE"],'apache/2')!== FALSE ? 1 : 0;
- echo '<tr><td><font size=2>Apache Version:&nbsp;</font></td>';
  echo '<td><font size=2>'.$_SERVER["SERVER_SOFTWARE"].($apache_check ? '' : '&nbsp;&nbsp;< Apache/2.0 !').'</font></td>';
  echo '<td><img src="'.($apache_check ? $io : $nio).'"></td></tr>';
  
--- 68,75 ----
  echo '<td><img src="'.(defined('OXYLBOX_VERSION') ? $io : $nio).'"></td></tr>';
  
  //apache version
+ $apache_check = stristr($_SERVER["SERVER_SOFTWARE"],'lighttpd')!== FALSE ? 1 : 0;
+ echo '<tr><td><font size=2>Server Version:&nbsp;</font></td>';
  echo '<td><font size=2>'.$_SERVER["SERVER_SOFTWARE"].($apache_check ? '' : '&nbsp;&nbsp;< Apache/2.0 !').'</font></td>';
  echo '<td><img src="'.($apache_check ? $io : $nio).'"></td></tr>';
  


oxyl_box_check.php.org :

<?php 
//####################################### Oxyl~Box 2.0 #####################################################

//+-------------------------------------------------------------------------------------------
//| oxyl_box_check.php
//| checks the oxyl box installation
//|History:
//| 041115 .............. LongDan - erstellt
//| 041201 .............. LongDan - Moved to common and $back for backjump defined
//| 041204 .............. LongDan - Errorhandling verbessert
//| 041207 .............. LongDan - Create Dir eingebaut!!
//| 050120 .............. Brause  - HMTL Code korrigiert
//|                               - temp path und playlist path testet jetzz ob ordner,file oder leer
//| 050508 .............. Brause  - CHANGE: $GLOBALS ['OXYL_ROOT'] anstatt _SERVER['DOCUMENT_ROOT']
//| 050605 .............. Brause  - FIX: Pfadcheck wurde userlevel ignoriert, nicht berechtigte pfade werden nicht mehr angezeigt
//| 050605 .............. Brause  - FIX: FileBrowser Check hinzu
//| 060122 .............. Brause  - FIX: Netzlaufwerke werden getestet
//| 060219 .............. Brause  - CHANGE: OXYL_HP constante hinzu
//+---------------------------------------------------------------------------------------------------

  include_once('design.inc');

//----------------------------------------------------------------------------------------------------
 $progcall = '<form action="oxyl_box_check.php" method="post" name="###">';

// Creates Directory if needed
//-------------------------------
if (isset($action) && $action=='mkdir')
   {
    check_dirs($dir);
   }

// Logfilekopf

$LOGFile  = "\r\n";
$LOGFile .= '+---------------------------------------------------------------------------------+' . "\r\n";
$LOGFile .= '|  oxyl~box Check  START                 ' . date("j M Y - H:i:s"). "\r\n";
$LOGFile .= '+---------------------------------------------------------------------------------+' . "\r\n";
$LOGFile .= '|  Server IP: ' . $GLOBALS['ip'] . '  Port: ' . $GLOBALS['port'] .  "\r\n";
$LOGFile .= '+---------------------------------------------------------------------------------+' . "\r\n";
$LOGFile .= '|  Operating System:   ' . PHP_OS  . "\r\n";
$LOGFile .= '|  Webserver Software: ' . $_SERVER["SERVER_SOFTWARE"]  . "\r\n";
$LOGFile .= '|  PHP Version:        ' . PHP_VERSION  . "\r\n";
$LOGFile .= '+---------------------------------------------------------------------------------+' . "\r\n";
$LOGFile .= '' . "\r\n";

// Parameter
$frwidth  = 400;
$frwidth2 = 100;
//$tabwidth = 500;
$io  = getimghref('oxyl_nav_ok.gif');
$nio = getimghref('oxyl_nav_cancel.gif');

gen_header_setup();

echo '<blockquote><h1><u>Oxyl Check ' . OXYLBOX_VERSION. '</u></h1>';
echo '<table border="1" cellpadding=5><tr><td>';

echo '<table>';

// Internet Check
//---------------------------------------------------------------------------------------
echo '<tr><td colspan=3><b>Oxylbox Versionen:</b></td></tr>';

//oxylbox version
echo '<tr><td><font size=2>Oxyl~Box Version:&nbsp;</font></td>';
echo '<td><font size=2>'.OXYLBOX_VERSION.'&nbsp;(Rel. '.OXYLBOX_RELEASE.'&nbsp;Kern&nbsp;'.OXYLBOX_KERN.')</font></td>';
echo '<td><img src="'.(defined('OXYLBOX_VERSION') ? $io : $nio).'"></td></tr>';

//apache version
$apache_check = stristr($_SERVER["SERVER_SOFTWARE"],'apache/2')!== FALSE ? 1 : 0;
echo '<tr><td><font size=2>Apache Version:&nbsp;</font></td>';
echo '<td><font size=2>'.$_SERVER["SERVER_SOFTWARE"].($apache_check ? '' : '&nbsp;&nbsp;< Apache/2.0 !').'</font></td>';
echo '<td><img src="'.($apache_check ? $io : $nio).'"></td></tr>';

//php version
$php_check = ((PHP_VERSION>='4.3.11'&&PHP_VERSION<5)||(PHP_VERSION>='5.0.4'&&PHP_VERSION>=5)) ? 1 : 0;
echo '<tr><td><font size=2>PHP Version:&nbsp;</font></td>';
echo '<td><font size=2>'.PHP_VERSION.($php_check ? '' : '&nbsp;&nbsp;< 4.3.11 or 5.0.4 !').'</font></td>';
echo '<td><img src="'.($php_check ? $io : $nio).'"></td></tr>';

//--------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';


// Oxyl-Pfad Check
//---------------------------------------------------------------------------------------
echo '<tr><td colspan=3><b>Oxyl System Paths:</b></td></tr>';
$ospc='';

// Check all oxyl path

      if (! is_dir(OXYL_EXEC))
		$ospc.='-BIN path not found!<br>';

      if (! is_dir(OXYL_KERN)) //lol wenn der nicht da ist funktioniert nichts
		$ospc.='-COMMON path not found!<br>';

      if (! is_dir(OXYL_CONF))
		$ospc.='-CONFIG path not found!<br>';

      if (! is_dir(OXYL_PICS))
		$ospc.='-IMAGES path not found!<br>';

      if (! is_dir(OXYL_PLUG))
		$ospc.='-PLUGINS path not found!<br>';

      if (! is_dir(OXYL_SKIN))
		$ospc.='-SKINS path not found!<br>';

      if (! is_dir(OXYL_ROOT.'versions'))
		$ospc.='-VERSIONS path not found!<br>';

 if (strlen($ospc)>0)
 {
  $LOGFile.='# Oxyl System Paths ERROR #'. "\r\n" . '---------------------------' . "\r\n".'#!'. str_replace('<br>',"\r\n" . '#!',$ospc). "\r\n";
  echo '<tr><td colspan=2 width="' . $frwidth . '"><font size=2>' . $ospc . '</td>';
  echo '<td width="' . $frwidth2 . '"><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
 }
 else
 {
  $LOGFile.='Oxyl System Paths OK'. "\r\n";
  echo '<tr><td colspan=2 width="' . $frwidth . '"><font size=2>Checked</td>';
  echo '<td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '"></td></tr>';
 }
//-----------------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';


// Oxyl-Consistency Check
//---------------------------------------------------------------------------------------
echo '<tr><td colspan=3><b>Oxyl System Check:</b></td></tr>';
$ospc='';

// Check all oxyl path

      if (! is_dir(OXYL_PLUG.'oxyl_setup'))
		$ospc.='-oxyl_setup path not found!<br>';

      if (! file_exists(OXYL_PLUG.'oxyl_setup/oxyl_setup_main.php'))
		$ospc.='-oxyl_setup_main.php not found!<br>';

      if (! file_exists(OXYL_PLUG.'oxyl_setup/oxyl_plugin.cfg'))
		$ospc.='-oxyl_plugin.cfg not found!<br>';

      if (! file_exists(OXYL_PLUG.'oxyl_setup/oxyl_box_setup.php'))
		$ospc.='-oxyl_box_setup.php not found!<br>';

 if (strlen($ospc)>0)
 {
  echo '<tr><td colspan=2><font size=2>' . $ospc . '</td>';
  echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
  $LOGFile.='# System Check ERROR #'. "\r\n" . '-----------------------' . "\r\n".'#!'.  str_replace('<br>',"\r\n" . '#!',$ospc) . "\r\n";
 }
 else
 {
  $LOGFile.='Oxyl System Check OK'. "\r\n";
  echo '<tr><td colspan=2><font size=2>Checked</td>';
  echo '<td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '"></td></tr>';
 }
//-----------------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';


// Temp-Pfad Check
//---------------------------------------------------------------------------------------
echo '<tr><td colspan=3><b>Temp-Path:</b></td></tr>';

    if (file_exists(OXYL_CONF.'temp.cfg'))
	{
     	echo '<tr><td colspan=2><font size=2></b>' . OXYL_TEMP.'</td>';
	    if (is_dir(OXYL_TEMP)){
		  $ctp=@fopen(OXYL_TEMP.'/testfile.txt','w');
 	      @fwrite($ctp,'Hallo Welt'."\n");
		  @fclose($ctp);
		  $ctp='';
		  $ctp=@fopen(OXYL_TEMP.'/testfile.txt','r');
		  $ctpline = trim(@fgets($ctp,1024));
		  @fclose($ctp);

          if (strlen($ctpline)>0) {
		    if (strpos($ctpline, 'Welt')) {
		      echo '<td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '"></td></tr>';
			  unlink ($path .'/testfile.txt');
			}
		    else{
		      echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		      echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Error during write access! Check Autorization and HTTP Config!</td></tr>';
			}
		  }
		  else{
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> No write access! Check Autorization and HTTP Config!</td></tr>';
          }
		}
	    else{// wenn "is_dir" false ist
		  if(file_exists($path)){// falls datei oder link...
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Temp-Path is not a Directory!</td></tr>';
		  }
		  elseif($path==""){// falls inhalt von cfg leer
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Temp-Path is not set! Set the Temp-Path in Oxyl Setup</td></tr>';
		  }
		  else{// wenn gar kein Verzeichnis oder file existiert
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3>';
		    echo str_replace('###','TEMP',$progcall);
		    echo '<img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Directory not found!&nbsp;&nbsp;<input type="submit" name="CD" value="Create Directory">';
		    echo '<input type="hidden" name="action" value="mkdir">';
		    echo '<input type="hidden" name="back" value="' . $back . '">';
		    echo '<input type="hidden" name="dir" value="' . $path . '">';
		    echo '</form></td></tr>';
          }
	    }
	}
      else{
		 echo '<tr><td colspan=2>Temp-Path not set!</td><td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		 echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Set the Temp-Path in Oxyl Setup</td></tr>';
	}
$LOGFile.='Temp Path= ' . $path. "\r\n";
//-----------------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';

// Playlist-Pfad Check
//---------------------------------------------------------------------------------------
echo '<tr><td colspan=3><b>Playlist-Path:</b></td></tr>';

   if (file_exists(OXYL_CONF.'plugins_oxyl_mp3_playlist.cfg'))
      {
       $fh=fopen(OXYL_CONF.'plugins_oxyl_mp3_playlist.cfg','r');
       $path=trim(fgets($fh,999));
       fclose($fh);
       echo '<tr><td colspan=2><font size=2></b>' . $path . '</td>';
	    if(is_dir($path))
		  {
		  $ctp=@fopen($path.'/testfile.txt','w');
 	      @fwrite($ctp,'Hallo Welt'."\n");
		  @fclose($ctp);
		  $ctp='';
		  $ctp=@fopen($path.'/testfile.txt','r');
		  $ctpline = trim(@fgets($ctp,1024));
		  @fclose($ctp);

		  if (strlen($ctpline)>0) {
		    if (strpos($ctpline, 'Welt')) {
		      echo '<td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '"></td></tr>';
			  unlink ($path .'/testfile.txt');
			}
		    else{
		      echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		      echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Error during write access!&nbsp;Check Autorization and HTTP Config!</td></tr>';
			}
 		  }
		  else{
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> No write access!&nbsp;Check Autorization and HTTP Config!</td></tr>';
          }
		}
	    else{// wenn "is_dir" false ist
		  if(file_exists($path)){// falls datei oder link...
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Playlist-Path is not a Directory!</td></tr>';
		  }
		  elseif($path==""){// falls inhalt von cfg leer
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Playlist-Path is not set! Set the Temp-Path in Oxyl Setup</td></tr>';
		  }
		  else{// wenn gar kein Verzeichnis oder file existiert
		    echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		    echo '<tr><td colspan=3><center>';
		    echo str_replace('###','PLPATH',$progcall);
			echo '<img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> Directory not found!&nbsp;&nbsp;<input type="submit" name="CD" value="Create Directory">';
		    echo '<input type="hidden" name="action" value="mkdir">';
		    echo '<input type="hidden" name="back" value="' . $back . '">';
		    echo '<input type="hidden" name="dir" value="' . $path . '">';
		    echo '</form></td></tr>';
		  }
	    }
      }
      else{
		echo '<tr><td colspan=2>Playlist-Path not set!</td><td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
		echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="middle"> Set the Playlist-Path in Oxyl Setup</td></tr>';
	}

$LOGFile.='Playlist Path= ' . $path. "\r\n";
//-----------------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';

// Video-Pfad Check
//---------------------------------------------------------------------------------------
$LOGFile.='Video Devices:'. "\r\n";
echo '<tr><td colspan=3><b>Video-Path:</b></td></tr>';

$devices = get_devices('plugins_oxyl_video_devices.cfg');
for ($i=0;$i<count($devices);$i++){
    echo '<tr><td><font size="-1">';
    $ret=Check_path($devices[$i]['path'],$devices[$i]['name'],$devices[$i]['level'],$GLOBALS['actuserlevel'],'OFF');
    if ($ret==0)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '" align="middle"></td></tr>';
    elseif($ret==1)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '" align="middle"></td></tr>';
	else
	  echo "";
}
//--------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';

// Audio-Pfad Check
//---------------------------------------------------------------------------------------
$LOGFile.='Audio Devices:'. "\r\n";
echo '<tr><td colspan=3><b>Audio-Path:</b></td></tr>';

$devices = get_devices('plugins_oxyl_mp3_devices.cfg');
for ($i=0;$i<count($devices);$i++){
    echo '<tr><td><font size="-1">';
    $ret=Check_path($devices[$i]['path'],$devices[$i]['name'],$devices[$i]['level'],0,'OFF');
    if ($ret==0)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '" align="middle"></td></tr>';
    else
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '" align="middle"></td></tr>';
}
//--------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';

// Pictures-Pfad Check
//---------------------------------------------------------------------------------------
$LOGFile.='Pictures Devices:'. "\r\n";
echo '<tr><td colspan=3><b>Pictures-Path:</b></td></tr>';

$devices = get_devices('plugins_oxyl_pic_devices.cfg');
for ($i=0;$i<count($devices);$i++){
    echo '<tr><td><font size="-1">';
    $ret=Check_path($devices[$i]['path'],$devices[$i]['name'],$devices[$i]['level'],$GLOBALS['actuserlevel'],'OFF');
    if ($ret==0)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '" align="middle"></td></tr>';
    elseif($ret==1)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '" align="middle"></td></tr>';
	else
	  echo "";
    }
//--------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';

// File-Pfad Check
//---------------------------------------------------------------------------------------
$LOGFile.='File Devices:'. "\r\n";
echo '<tr><td colspan=3><b>File-Path:</b></td></tr>';

$devices = get_devices('plugins_oxyl_file_devices.cfg');
for ($i=0;$i<count($devices);$i++){
    echo '<tr><td><font size="-1">';
    $ret=Check_path($devices[$i]['path'],$devices[$i]['name'],$devices[$i]['level'],$GLOBALS['actuserlevel'],'OFF');
    if ($ret==0)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '" align="middle"></td></tr>';
    elseif($ret==1)
	  echo '</td><td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '" align="middle"></td></tr>';
	else
	  echo "";
    }
//--------------------------------------------------------------------------------------

echo '<tr><td colspan=3><hr></td></tr>';


// Internet Check
//---------------------------------------------------------------------------------------
echo '<tr><td colspan=3><b>Internet Connection:</b></td></tr>';

echo '<tr><td colspan=2><font size=2></b>' . OXYL_HP . '</td>';

if (remote_file_exists(OXYL_HP)){
   $LOGFile.='Internet Connection OK'. "\r\n";
   echo '<td><center><img src="' . getimghref('oxyl_nav_ok.gif') . '"></td></tr>';
}
else{
   $LOGFile.='Internet Connection failed'. "\r\n";
   echo '<td><center><img src="' . getimghref('oxyl_nav_cancel.gif') . '"></td></tr>';
   echo '<tr><td colspan=3><center><img src="' . getimghref('oxyl_nav_right.gif') . '" align="absmiddle"> No Internet Connection Check Internet and Proxy Settings</td></tr>';
}

echo '</table>';

//---------------------------------------------------------------------------------------

echo '</td></tr></table></blockquote><br>';

    echo '<hr color="#000000">';
    echo '<a href="' . $back . '">&nbsp;... '.trans('','back').'</a><br><br><br>';
    gen_end();


$LOGFile .= '' . "\r\n";
$LOGFile .= '+---------------------------------------------------------------------------------+' . "\r\n";
$LOGFile .= '|  oxyl~box Check  E N D                 ' . date("j M Y - H:i:s"). "\r\n";
$LOGFile .= '+---------------------------------------------------------------------------------+';

$ctp=@fopen(OXYL_ROOT.'oxyl_CHECK_Log.txt','wb');
 @fwrite($ctp,$LOGFile);
 @fclose($ctp);


die();

//--------------------------------------------------------------------------------------------


//+------------------------------------------------------------------------------------------
//|FUNKTION: Check_Path
//| Überprüft ob Pfad existiert, darauf Zugegriffen werden kann
//| und der Benutzer authorisiert ist!
//|
//| History:
//|  20040817 .............. LongDan - erstellt
//|  20040828 .............. LongDan - silent mode added
//|  20050120 .............. Brause  - Kosmetik durch tabellenlayout ersetzt
//+------------------------------------------------------------------------------------------
function Check_Path($pathname,$oname,$level,$userlevel,$silent='OFF') {
Global $LOGFile;
$IS_UNC = substr($pathname,0,2)=='//' ? 1 : 0;
// Authorisation
if ((int)($level)<(int)($userlevel))
{
   //if ($silent=='OFF')
   //  echo '<b>---</b></td><td>No authorisation with current User!<br>';
   $LOGFile.="--- \tNo authorisation with current User! \r\n";
   return 2;
}
// Pfad gültig?
//----------------------
if($IS_UNC)
{
  if(!$handle=opendir ($pathname))
  {
    if ($silent=='OFF')
      echo '<b>' . $oname . '&nbsp;&nbsp;</b></td><td width="' . $frwidth2 . '"><i>Netshare - invalid: </i>&nbsp;&nbsp;' . $pathname . '<br>';
	$LOGFile.=$oname."\t".$pathname. "\tNetshare - invalid\r\n";
    return 0;
  }
  closedir($handle);
}
else // Dateiverzeichnis
{
  // Pfad gültig?
  //----------------------
  if (!is_dir($pathname))
  {
    if ($silent=='OFF')
      echo '<b>' . $oname . '&nbsp;&nbsp;</b></td><td width="' . $frwidth2 . '"><i>Path - invalid: </i>&nbsp;&nbsp;' . $pathname . '<br>';
    $LOGFile.=$oname."\t".$pathname. "\tPath - invalid\r\n";
    return 0;
  }
  // Zugriff auf Pfad?
  //----------------------
  if (@dir($pathname) =='')
  {
    if ($silent=='OFF')
      echo '<b>' . $oname . '&nbsp;&nbsp;</b></td><td><i>Unmounted: </i>&nbsp;&nbsp;' . $pathname . '<br>';
    $LOGFile.=$oname."\t".$pathname. "\tUnmounted\r\n";
    return 0;
  }
}

if ($silent=='OFF')
  echo '<b>' . $oname .'&nbsp;&nbsp;</b></td><td>' .($IS_UNC ? 'Netshare: ':''). $pathname . '<br>';
$LOGFile.=$oname."\t".$pathname. "\tOK\r\n";
return 1;

}// end function

//*****************************************************************************************************
?>