Hi,

Originally Posted by
wengi
... Dir ist bewusst, dass es sich um shell-scripts handelt, die html Dateien generieren?
Jo
.
Also was habe ich gemacht?:
A.) Zuerst mal nach dem Paket gesucht:
PHP Code:
ipkg list | grep ipkg
ipkg-opt - 0.99.163-9 - The Itsy Package Manager
ipkg-web - 7-7 - A web frontend for ipkg
B.) Dann versucht das Paket zu installieren mit ipkg:
PHP Code:
ipkg install ipkg-web
Installing ipkg-web (7-7) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-web_7-7_mipsel.ipk
ipkg: extract_archive: /home/httpd/: Read-only file system
ipkg: extract_archive: /home/httpd/html/: No such file or directory
ipkg: extract_archive: /home/httpd/html/Management/: No such file or directory
ipkg: /home/httpd/html/Management/sluginfo.cgi: No such file or directory
ipkg: /home/httpd/html/Management/package.cgi: No such file or directory
Configuring ipkg-web
Successfully terminated.
Was natürlich nicht geht da die Pfadangaben zu dem WebServer auf der NSLU2-Debian ganz anders sind als die der ASUS-Oleg-FirmeWare mit naträglich installiertem thttpd-WebServer oder LightHTTP.
C.) Nun das Paket im Win geladen mit der URL von oben:
http://ipkg.nslu2-linux.org/feeds/op...7-7_mipsel.ipk
D.) Aus ipkg-web_7-7_mipsel.ipk einfach ipkg-web_7-7_mipsel.ipk.rar gemacht durch umbenennen.
E.) Das ganze entpackt bis ich die beiden Dateien hatte:
package.cgi
sluginfo.cgi
F.) Die dann per WinSCP oder per Samba auf meine WL-HDD geschoben,
in den Web-Ordner vom thttpd/2.25b PHP/5.2.5 /opt/share/www/cgi-bin
G.) das .cgi entfernt als Dateiendung
H.) zum testen erstmal alle Rechte den beiden Dateien gegeben
I.) dann in Browser aufgerufen
http://IP.of.your.Router:8080/cgi-bin/sluginfo
und es funktioneirt (siehe auch Bildanhang):
Slug info
System
Installed software
Disks
Network
samba
System
uname
Linux Willi 2.4.20 #75 Fri Apr 6 00:12:23 MSD 2007 mips GNU/Linux
cpuinfo
system type : Broadcom BCM947XX
J.) dann in Browser aufgerufen
http://IP.of.your.Router:8080/cgi-bin/package
und zeigt erstmal die Seite an, fein fein bis hier hin, aber eben nur bis hier hin (siehe Bildanhang).
The ipkg web frontend
Sync packages no yes
Type: NONE Updates Installed Not installed
Filter
Please install bash
I recomend to install bash because this cgi script will run more than two times faster with bash
K.) So jetzt auf Type. Installed gesetz und Anfrage senden
und schon kommt die Fehlermeldung (siehe Bildanhang):
package02: package02: 248: ipkg: not found
L.) nun munter in der "package" mit einem Texteditor drin rum gewurzelt und keine Erfogle erziehl, nur nebenbei ein bischen Shell-Script gelernt.
Das hier habe ich installiert:
PHP Code:
ipkg list_installed | grep php
php - 5.2.5-1 - The php scripting language
php-thttpd - 2.25b-5.2.5-1 - php-thttpd is thttpd webserver with php support
PHP Code:
ipkg list_installed | grep http
php-thttpd - 2.25b-5.2.5-1 - php-thttpd is thttpd webserver with php support
PHP Code:
ipkg list_installed | grep cgi
[admin@Willi cgi-bin]$
So jetzt habe ich mal das gemacht:
PHP Code:
ipkg list | grep cgi
haserl - 0.9.20-1 - Haserl is a small program that uses shell or Lua script to create cgi web scripts.
mod-fastcgi - 2.4.2-3 - mod_fastcgi is an Apache module providing language independent, scalable, open extension to CGI.
perl-cgi-application - 3.31-2 - Framework for building reusable web-applications
perl-scgi - 0.6-1 - The Perl SCGI server library.
php-fcgi - 5.2.5-1 - The php scripting language, built as an fcgi module
py-scgi - 1.12-2 - Server-side implementation of the SCGI protocol.
py25-scgi - 1.12-2 - Server-side implementation of the SCGI protocol.
Und dann das installiert:
PHP Code:
ipkg install php-fcgi
Installing php-fcgi (5.2.5-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/php-fcgi_5.2.5-1_mipsel.ipk
Configuring php-fcgi
Successfully terminated.
Hat auch nix gebracht. Was muß ich da noch konfigurieren an dem "php-fcgi"?
-----------------------------------------------------------------------------------------
So rufe ich nun das Script ohne Parameter über Putty auf kommt das:
PHP Code:
[admin@Willi cgi-bin]$ ./package02
Content-type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="CGI:shell" />
<meta name="version" content="$Id: package.cgi 6240 2007-06-17 22:29:05Z marceln $" />
<title>ipkg web</title>
<style type="text/css">
h1, h2 {
font-family: Arial, Helvetica, sans-serif;
color: #004;
}
table {
border-top: 1px solid #eee;
border-right: 1px solid #eee;
width: 100%;
}
th, td {
padding: 2px 4px;
border-left: 1px solid #eee;
border-bottom: 1px solid #eee;
}
table a {
background: #ddd;
color: #004;
text-decoration: none;
margin: 1px;
padding: 2px 4px;
font-family: Arial, Helvetica, sans-serif;
font-size: 75%;
}
table a.ins {
background: #dfd;
border-left: 1px solid #cec;
border-bottom: 1px solid #cec;
}
table a.upd {
background: #ddf;
border-left: 1px solid #cce;
border-bottom: 1px solid #cce;
}
table a.del {
background: #fdd;
border-left: 1px solid #ecc;
border-bottom: 1px solid #ecc;
}
</style>
</head>
<body>
<h1>The ipkg web frontend</h1>
<form methode="GET">
<table>
<tr>
<td>Sync packages</td>
<td>
<input type="radio" name="updatedb" value="n" checked>no</input>
<input type="radio" name="updatedb" value="y">yes</input>
</td>
</tr>
<tr>
<td>Type:</td>
<td>
<select name="typefilter">
<option selected value="none">NONE</option>
<option value="update">Updates</option>
<option value="installed">Installed</option>
<option value="not">Not installed</option>
</select>
</td>
</tr>
<tr>
<td>Filter</td>
<td><input type="text" name="namefilter"></td>
</tr>
</table>
<input type="submit" name="submit"> <input type="reset">
</form>
<h2>Please install bash</h2>
<p>I recomend to install bash because this cgi script will
run more than two times faster with bash</p>
</body>
</html>
Hole ich mir jetzt die Paramer von der URL:
http://IP.of.your.Router:8080/package?updatedb=n&typefilter=installed&namefilter=&submi t=Anfrage+senden
PHP Code:
?updatedb=n&typefilter=installed&namefilter=&submit=Anfrage+senden
und setzte die an den Aufruf hinten drann
PHP Code:
./package?updatedb=n&typefilter=installed&namefilter=&submit=Anfrage+senden
kommt das:
PHP Code:
[admin@Willi cgi-bin]$ ./package?updatedb=n&typefilter=installed&namefilter=&submit=Anfrage+senden
-sh: ./package02?updatedb=n: not found
[3] + Done ./package02?updatedb=n
[2] + Done ./package02?updatedb=n
[1] + Done(127) ./package02?updatedb=n
Scheinbar ist die Parameterübergabe nicht richtig um das per Konsole aufzurifen.
Wie müsste die erfoglen?

Originally Posted by
wengi
Eigentlich müssen die nur ausgeführt werden. Das Script überprüft ob bash installiert ist, macht aber auch ohne bash weiter...
Würde das da auch ganz ohne cgi gehen?
Könnte ich das auch über den Origianl-Oleg-ASUS-WebServer aufrufen?
Müsste doch irgendwie zu machen sein oder?
Ich kann ja Befehle / Programme / ShellScripte mit der Original-Oleg-ASUS-WebServer aufrufen unter http://10.0.2.93/Main_AdmStatus_Content.asp.
Das habe ich ja auch für mein SIS-PM-WebGui genutzt.

Originally Posted by
wengi
Ich werds bei gelegenheit mal testen
Jo, das wäre nett wenn du da auch mal mit dran bleiben köntest.
Ist ja nicht so das das Script lebensnotwendig wäre aber, wissen wann und warum nicht es geht oder nicht geht wöllte ich schon.
Gruß.