Page 5 of 5 FirstFirst ... 345
Results 61 to 63 of 63

Thread: ipkg-Web-Managment cgi-bin Script von NSLU2 auf WL-HDD + ASUS umbauen

  1. #61
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Quote Originally Posted by bauerj View Post
    Sagt mal, wie krieg ich das denn mit dem busybox_httpd zum laufen
    Was hab ich falsch gemacht?
    Naja, da fehlt einiges:
    siehe: http://www.wl500g.info/showpost.php?p=92347&postcount=5

    das Router-Webif kann natürlich auf Port 80 bleiben, der im o.a. Beispiel genannte Aufruf startet den Webserver für Port 8080.

    und den Aufruf von cgi: http://de.selfhtml.org/servercgi/cgi...tm#cgi_aufrufe

    eventuell auch hier im Forum suchen, bzw. googeln.

    Have fun
    Newbiefan

    Edit: hätte ich fast vergessen - natürlich das Verzeichnis und den Script auf 755 setzen, bzw. die Rechte für den betreffenden User setzen.
    Last edited by newbiefan; 30-12-2010 at 19:54.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

  2. #62
    Nein, die Rechte reichen auf jeden Fall aus
    [bauerj@BAUER cgi-bin]$ ls -l *cgi*
    -rwxrwxrwx 1 bauerj root 7761 Dec 15 16:25 package.cgi
    Es scheint vielmehr am Inhalt der Datei zu liegen Wenn ich eine Datei "index.html" erstelle und hereinschreibe:
    #!/bin/sh
    echo "echo"
    Wie man sieht, kenne ich mich mit cgi nicht aus^^

    Naja, diese datei kann jetzt problemlos aufgerufen werden. Bis auf den Namen und den Inhalt ist aber alles gleich.
    [bauerj@BAUER cgi-bin]$ busybox_httpd -p 81 -h .. -vv -f
    [::ffff:192.168.1.52]:2521: url:/cgi-bin/index.html
    [::ffff:192.168.1.52]:2522: url:/favicon.ico
    [::ffff:192.168.1.52]:2522: response:404
    [::ffff:192.168.1.52]:2524: url:/cgi-bin/package.cgi
    [::ffff:192.168.1.52]:2524: exec package.cgi: No such file or directory
    [::ffff:192.168.1.52]:2524: response:404
    Liegt es vielleicht am cgi-script?
    Hier mal zum kopieren:
    PHP Code:
    #!/bin/sh
    #
    # $Id$
    #

    if [ "${BASH_CHECK}!= --/opt/bin/bash ]
    then
        BASH_CHECK
    =1export BASH_CHECK
        
    /opt/bin/bash $0
        
    exit $$
    fi

    PROG
    =${0##*/}
    TMPFILE=/tmp/${PROG}.$$

    #
    # HTML Header
    #
    cat << EOF
    Content
    -typetext/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$" />
    <
    title>ipkg web</title>
    <
    style type="text/css">
    body{}
    body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,sans-serif}
    table{-moz-box-sizing:border-box;border-collapse:separate;border-spacing:2px;display:table;text-indent:0margin-bottom:30px}
    table,caption{border-left:1px solid #CCC;border-right:1px solid #CCC}
    caption,th,td{padding:8px}
    caption,tfoot td{text-transform:uppercase}
    caption{-moz-border-radius:6px 6px 0 0;-webkit-border-radius:6px 6px 0 0;background-color:#FFFBCC;border-color:#E6DB55;border-style:solid;border-width:1px 1px 0;color:#555;font-size:12px;line-height:19px;padding:7px 0;text-align:center}
    thead{display:table-header-group;vertical-align:middle}
    tfoot{display:table-footer-group;vertical-align:middle}
    tbody{display:table-row-group;vertical-align:middle}
    tbody tr:hover{background-color:#EEE;color:#333}
    tbody tr:hover a{background-color:#FFF}
    tr{display:table-row;vertical-align:inherit}
    tr:nth-child(odd){background:#fafafa}
    th{display:table-cell;font-weight:700;padding:1px;vertical-align:inherit}
    td{vertical-align:middle}
    table a{background:#ddd;color:#004;font-size:90%;margin:1px;padding:2px 4px;text-decoration:none}
    table a.ins{background:#dfd;border-bottom:1px solid #cec;border-left:1px solid #cec}
    table a.upd{background:#FFFBCC;border-bottom:1px solid #E6DB55;border-left:1px solid #E6DB55}
    table a.del{background:#fdd;border-bottom:1px solid #ecc;border-left:1px solid #ecc}
    .wide{-moz-border-radius:0 0 4px 4px;-webkit-border-radius:0 0 4px 4px;background-color:#FFF;border-color:#DFDFDF;border-spacing:0;border-style:solid;border-width:1px;clear:both;margin:20px auto 10px;width:96%}
    .wide thead tr th,.wide tfoot tr th{background:#DFDFDF;color:#333}
    .wide th{line-height:1.3em;padding:7px 7px 8px;text-align:left;text-shadow:0 1px 0 rgba(2552552550.8)}
    .
    wide td,.wide th{border-bottom-style:solid;border-bottom-width:1px;border-color:#DFDFDF;font-size:11px;overflow:hidden}
    textarea overflowautofont-size9pxwidth99%; color:#222; line-height:16px; }
    </style>
    </
    head>

    <
    body>
    <
    form methode="GET">
    <
    table class="wide">
    <
    caption>The ipkg web frontend</caption>
    <
    tfoot><tr><th colspan="2"><input type="submit" name="submit">&nbsp;<input type="reset"></th></tr></tfoot>
    <
    tbody>
    <
    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>
    </
    tbody>
    </
    table>
    </
    form>
    EOF

    NAMEFILTER
    =.

    # QUERY_STRING=task=install&package=atk
    IFS='&'
    set -- ${QUERY_STRING}
    for 
    i in $@
    do
        case ${
    i%%=*} in
            task
    )
                
    TASK="${i#*=}"
                
    ;;
            
    package)
                
    PACKAGE="${i#*=}"
                
    ;;
            
    updatedb)
                
    UPDATEDB="${i#*=}"
                
    ;;
            
    typefilter)
                
    TYPEFILTER="${i#*=}"
                
    ;;
            
    namefilter)
                if [ 
    "${i#*=}" ]
                
    then
                    NAMEFILTER
    ="${i#*=}"
                
    fi
                
    ;;
            
    submit)
                
    SUBMIT="${i#*=}"
                
    ;;
            *)
                echo 
    "<b>ERROR</b>: Unkown option '${i}'"
                
    echo '</body>'
                
    echo '</html>'
                
    exit 1
                
    ;;
        
    esac
    done




    if [ ! -/opt/bin/bash ]
    then 
        
    echo '<table class="wide"> '
        
    echo '<caption>Warning!</caption>'    
        
    echo '<thead><tr><th>Important information &ndash; Please install bash!</th></tr></thead>'
        
    echo '<tbody><tr><td>'
        
    echo "I recomend to install bash because this cgi script will run more than two times faster with bash"
        
    echo '</td></tr></tbody>'
        
    echo '</table>'
    fi

    if [ "${UPDATEDB}]
    then
        
    echo '<table class="wide"> '
        
    echo '<caption>Upgrading package list</caption>'    
        
    echo '<thead><tr><th>Display process</th></tr></thead>'
        
    echo '<tbody><tr><td align="center"><textarea rows="4" name="updateinfo">'
        
    /opt/bin/ipkg update </dev/null
        
    echo '</textarea></td></tr></tbody>'
        
    echo '</table>'
    fi

    if [ "${TASK}install ]
    then
        
    echo '<table class="wide"> '
        
    echo '<caption>Install &bull;' ${PACKAGE'</caption>'    
        
    echo '<thead><tr><th>Display process</th></tr></thead>'
        
    echo '<tbody><tr><td align="center"><textarea rows="4" name="installinfo">'
        
    /opt/bin/ipkg -force-defaults install "${PACKAGE}</dev/null
        
    echo '</textarea></td></tr></tbody>'
        
    echo '</table>'    
    fi

    if [ "${TASK}update ]
    then
        
    echo '<table class="wide"> '
        
    echo '<caption>Update &bull;' ${PACKAGE'</caption>'    
        
    echo '<thead><tr><th>Display process</th></tr></thead>'
        
    echo '<tbody><tr><td align="center"><textarea rows="4" name="upgradeinfo">'
        
    /opt/bin/ipkg -force-defaults upgrade "${PACKAGE}</dev/null
        
    echo '</textarea></td></tr></tbody>'
        
    echo '</table>'    
    fi

    if [ "${TASK}delete ]
    then
        
    echo '<table class="wide">'
        
    echo '<caption>Delete &bull' ${PACKAGE'</caption>'    
        
    echo '<thead><tr><th>Display process</th></tr></thead>'
        
    echo '<tbody><tr><td align="center"><textarea rows="4" name="deleteinfo">'
        
    /opt/bin/ipkg -force-defaults remove "${PACKAGE}</dev/null
        
    echo '</textarea></td></tr></tbody>'
        
    echo '</table>'        
    fi

    if [ "${SUBMIT}!= ""  ]
    then    
        
    /opt/bin/ipkg list_installed >${TMPFILE}
        
    trap "[ -f ${TMPFILE} ] && rm ${TMPFILE}0

        
    echo '<table class="wide"> '
        
    echo '<caption>Package list</caption>'    
        
    echo '<thead><tr><th>Task</th><th>Package</th><th>I-Ver</th><th>P-Ver</th><th>Comment</th><th>Action</th></tr></thead>'
        
    echo '<tfoot><tr><th>Task</th><th>Package</th><th>I-Ver</th><th>P-Ver</th><th>Comment</th><th>Action</th></tr></tfoot>'    
        
    echo '<tbody>'
        
        
    /opt/bin/ipkg list | grep -- "${NAMEFILTER}| while read line
        
    do
            
    INSTALLED=""
            
    NAME=${line%% - *}
            
    line=${line#* - }
            
    VERSION=${line%% - *}
            
    VERSION=${VERSION% -}
            
    COMMENT=${line#* - }
            
    if [ "$COMMENT"$line]
            
    then
                COMMENT
    ='&nbsp;'
            
    fi
            instline
    =$(grep "^${NAME} - " ${TMPFILE})
            if [ 
    "${instline}!= "" ]
            
    then
                INSTALLED
    =Y
                DEL
    ="<a href='$PROG?task=delete&amp;package=${NAME}' class='del'>delete</a>"
                
    instline=${instline#* - }
                
    IVER=${instline%% - *}
                if [ 
    "${IVER}"${VERSION}]
                
    then
                    TASK
    ='&nbsp;'
                
    else
                    
    TASK="<a href='$PROG?task=update&amp;package=${NAME}' class='upd'>update</a>"
                
    fi
            
    else
                
    DEL='&nbsp;'
                
    IVER='&nbsp;'
                
    TASK="<a href='$PROG?task=install&amp;package=${NAME}' class='ins'>install</a>"
            
    fi
            SHOW
    =0
            
    case "${TYPEFILTER}in
                none
    )
                    
    SHOW=1
                    
    ;;
                
    update)
                    [ 
    "${INSTALLED}] && [ "${IVER}!= "${VERSION}] && SHOW=1
                    
    ;;
                
    installed)
                    [ 
    "${INSTALLED}] && SHOW=1
                    
    ;;
                
    not)
                    [ -
    "${INSTALLED}] && SHOW=1
                    
    ;;
                *)
                    echo 
    "<b>ERROR</b>: Unkown typefilter '${TYPEFILTER}'"
                    
    echo '</body>'
                    
    echo '</html>'
                    
    exit 1
                    
    ;;
            
    esac
            
    "${SHOW}] && echo "<tr><td>${TASK}</td><td>${NAME}</td><td>${IVER}</td><td>${VERSION}</td><td>${COMMENT}</td><td>${DEL}</td></tr>"
        
    done
        
    echo '</tbody></table>'
    fi

    echo '</body>'
    echo '</html>' 
    Läuft das Script denn bei dir?

  3. #63
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Ja läuft - ich habe das Script von etwas weiter oben genommen, es läuft sofort ohne jeden Fehler!
    Ich habe allerdings einige Tools installiert, z.Bspl. die Bash (siehe alle howtos bash Erweiterung)
    Ich lege dir die IPKG-Scriptausgabe meiner installierten Software bei......
    Zur Zeit läuft bei mir die Ily FW Version d-r1222

    Viel Spass

    Edit: Dein Script läuft zwar, bringt aber einiges an Müll-Ausgaben mit.........
    Ich habe das Script von hier genommen: http://www.wl500g.info/attachment.ph...1&d=1292158017
    Dann habe ich ein Dir angelegt /opt/wwwp und /opt/wwwp/cgi-bin und den File kopiert, Rechte auf 755 gesetzt und
    den busybox_httpd genau so wie in meinem Posting (Link) von vorher angegeben, von Hand gestartet.
    Dann liegt die Seite bei mir auf http://IP.vom.Asus:8080/cgi-bin/package.cgi - funzt ohne jedes Problem!
    Attached Images Attached Images
    Last edited by newbiefan; 03-01-2011 at 17:44.
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

Page 5 of 5 FirstFirst ... 345

Similar Threads

  1. [Prob] Mediatomb UPnP Media Server auf dem Asus Wl-500 gP (Oleg)? Wie?
    By edelknecht in forum German Discussion - Deutsch (DE)
    Replies: 15
    Last Post: 16-04-2010, 12:54
  2. System-Aufbau von Oleg-FW auf den ASUS-Rouern gesucht
    By WLAN-Fan in forum German Discussion - Deutsch (DE)
    Replies: 7
    Last Post: 14-12-2007, 12:44
  3. Asus WL-500G en Linksys NSLU2
    By VEJ in forum Dutch Discussion - Nederlands
    Replies: 0
    Last Post: 06-12-2007, 21:23
  4. Verbinden von zwei WL500GP klappt nicht
    By marrrtin in forum German Discussion - Deutsch (DE)
    Replies: 13
    Last Post: 09-08-2007, 15:34

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •