Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 63

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

  1. #31
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Zu spät. Kann mir mal jemand den Inhalt seiner exports posten?
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  2. #32
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    423

    /opt/etc/exports Datei gar nicht vorhanden

    Quote Originally Posted by wengi View Post
    Zu spät. Kann mir mal jemand den Inhalt seiner exports posten?
    wolte ich machen nur habe ich die Datei gar nicht.

  3. #33
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Ist wirklich nur für nfsd.

    Danke
    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  4. #34
    OMG!
    Ich meinte nicht die exports Datei! Ich verschreib mich da dauernd! Ich meinte die profile Datei!
    export Datei sollte er eigentlich nicht angreifen und die liegt ja im /etc/exports

    Jetzt wird halt deine profile Datei weg sein! Sry fürs verwechseln!

    @WLAN-FAN: sag einfach ipkg install bash dann schreibt er dir die Quelle hin!
    Das markierst du und sagst, wget url_bash.ipk und dann tar xzvf bash.ipk und dann tar xzvf data.tar.gz und du hast deine binary

  5. #35
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    kannst Du mir mal die profile posten?
    Danke
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  6. #36
    Meine sieht so aus

    if [ `/opt/bin/whoami` != root ]; then
    echo -e "USER IS NOT ALLOWED FOR ANY TERMINAL SESSION!\nCONNECTION CLOSED!"
    exit
    fi

    export TERMINFO=/opt/share/terminfo

    alias df='df -H'
    alias ls='ls --color=auto -la'
    alias traffic='vnstat -u && vnstat'
    alias devices='nmap -sP 192.168.0.0/24'
    alias unix2dos='recode lat1..ibmpc'
    alias dos2unix='recode ibmpc..lat1'
    alias mount='/bin/mount'
    Hab halt ne Überprüfung, das sich nur root einloggen kann!
    Da ich über vsftpd das andere unterbinde!

  7. #37
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    423

  8. #38
    /opt/etc/profile
    Und die muss ausführbar (chmod +x) sein, sonst wirds beim Anmelden net ausgeführt!

  9. #39
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Danke
    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  10. #40
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    @WLAN-Fan

    Dein Posteingang ist voll.

    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  11. #41
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    118
    bei mir funktioniert das Script wunderbar. Auch mit installierem bash.
    Dauert zwar etwas bis die Seite aufgebaut ist nach ner Abfrage aber das ist annehmbar.
    Hab nur in der Package.cgi noch was abändern müssen. ipkg alleine hat er als Befehl nicht gecheckt, hab dann einfach den kompletten Pfad eingefügt, also /opt/bin/ipkg.
    Die Sluginfo.cgi hab ich auch noch angepasst, z.B. IPKG Pfad aktualisiert und Samba etc die Pfade zu der Logdatei richtig gesetzt.
    Wirklich ne tolle Sache das Script

    Gruß FastJack

  12. #42
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    423
    Quote Originally Posted by FastJack View Post
    bei mir funktioniert das Script wunderbar. Auch mit installierem bash.
    Dauert zwar etwas bis die Seite aufgebaut ist nach ner Abfrage aber das ist annehmbar.
    Hab nur in der Package.cgi noch was abändern müssen. ipkg alleine hat er als Befehl nicht gecheckt, hab dann einfach den kompletten Pfad eingefügt, also /opt/bin/ipkg.
    Die Sluginfo.cgi hab ich auch noch angepasst, z.B. IPKG Pfad aktualisiert und Samba etc die Pfade zu der Logdatei richtig gesetzt.
    Wirklich ne tolle Sache das Script

    Gruß FastJack
    Auf was für einem Gerät?

    Gruß.

  13. #43
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    118
    Hi WLAN-Fan,

    sorry gerade erst Deine Frage gesehen. Ich hab ein wl500gP.
    also habs erst letztens neu aufgesetzt. Spaßeshalber mal das Script mit und ohne Bash getestet und man merkt schon nen Unterschied beim Seitenaufbau.

    Gruß FastJack
    Last edited by FastJack; 28-03-2008 at 13:45. Reason: typo

  14. #44
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Quote Originally Posted by FastJack View Post
    Hab nur in der Package.cgi noch was abändern müssen. ipkg alleine hat er als Befehl nicht gecheckt, hab dann einfach den kompletten Pfad eingefügt, also /opt/bin/ipkg.
    Die Sluginfo.cgi hab ich auch noch angepasst, z.B. IPKG Pfad aktualisiert und Samba etc die Pfade zu der Logdatei richtig gesetzt.
    Würdest Du uns die korrigierten Versionen mal zu Verfügung stellen?
    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  15. #45
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    118
    Quote Originally Posted by wengi View Post
    Würdest Du uns die korrigierten Versionen mal zu Verfügung stellen?
    wengi
    Klar, hier der Code:

    sluginfo.cgi
    Code:
    #!/bin/sh
    #
    # $Id$
    #
    if [ "${BASH_CHECK}" != 1 -a -f /opt/bin/bash ]
    then
    	BASH_CHECK=1; export BASH_CHECK
    	/opt/bin/bash $0
    	exit $$
    fi
    
    showcommand() {
    	NAME=$1
    	shift
    	PROG=$1
    	shift
    	if [ -f ${PROG} ]
    	then
    		echo "<h3>${NAME}</h3>"
    		echo "<pre>"
    		${PROG} "$@"
    		echo "</pre>"
    	fi
    }
    
    showfile() {
    	FILE=$1;
    	BASE=${FILE##*/}
    	shift
    	if [ -f "${FILE}" ]
    	then
    		showcommand "${BASE}" "/bin/cat" "${FILE}"
    	fi
    }
    
    runprog() {
    	PROG=$1;
    	BASE=${PROG##*/}
    	shift
    	showcommand "${BASE}" "${PROG}" "$@"
    }
    
    cd /tmp
    cat << EOF
    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="sh" />
      <meta name="version" content="\$Id$" />
      <title>sluginfo</title>
    </head>
    <body>
    <h1>Slug info</h1>
    <ol>
    <li><a href="#sys">System</a></li>
    <li><a href="#soft">Installed software</a></li>
    <li><a href="#disk">Disks</a></li>
    <li><a href="#network">Network</a></li>
    <li><a href="#samba">samba</a></li>
    </ol>
    EOF
    echo '<a id="sys" /><h2>System</h2>'
    showfile /etc/motd 
    runprog /opt/bin/uname -a
    showfile /proc/cpuinfo
    showfile /proc/meminfo
    showfile /proc/bus/usb/devices
    runprog /sbin/lsmod
    runprog /bin/ps
    runprog /bin/dmesg
    echo '<a id="soft" /><h2>Installed software</h2>'
    runprog /opt/bin/ipkg list_installed
    echo '<a id="disk" /><h2>Disks</h2>'
    showfile /proc/mounts
    runprog /bin/df
    showcommand "sda" /sbin/fdisk -l /dev/sda
    showcommand "sdb" /sbin/fdisk -l /dev/sdb
    showcommand "sdc" /sbin/fdisk -l /dev/sdc
    showcommand "sdd" /sbin/fdisk -l /dev/sdd
    echo '<a id="network" /><h2>Network</h2>'
    runprog /sbin/ifconfig
    runprog /sbin/route
    showfile /etc/resolv.conf
    runprog /opt/bin/host ipkg.nslu2-linux.org
    runprog /bin/ping -c 2 ipkg.nslu2-linux.org
    runprog /usr/bin/wget http://ipkg.nslu2-linux.org
    echo '<a id="samba" /><h2>Samba</h2>'
    showfile /opt/etc/samba/smb.conf
    showfile /etc/samba/user_smb.conf
    showfile /opt/var/log/samba/log.smbd
    showfile /opt/var/log/samba/log.nmbd
    echo '</body>'
    echo '</html>'
    package.cgi
    Code:
    #!/bin/sh
    #
    # $Id$
    #
    
    if [ "${BASH_CHECK}" != 1 -a -f /opt/bin/bash ]
    then
    	BASH_CHECK=1; export BASH_CHECK
    	/opt/bin/bash $0
    	exit $$
    fi
    
    PROG=${0##*/}
    TMPFILE=/tmp/${PROG}.$$
    
    #
    # HTML Header
    #
    cat << EOF
    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$" />
    <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">&nbsp;<input type="reset">
    </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 [ ! -f /opt/bin/bash ]
    then
    	echo "<h2>Please install bash</h2>"
    	echo "<p>I recomend to install bash because this cgi script will"
    	echo "run more than two times faster with bash</p>"
    fi
    
    if [ "${UPDATEDB}" = y ]
    then
    	echo "<h2>Upgrading package list</h2>"
    	echo '<pre>'
    	/opt/bin/ipkg update </dev/null
    	echo '</pre>'
    fi
    
    if [ "${TASK}" = install ]
    then
    	echo "<h2>Install ${PACKAGE}</h2>"
    	echo '<pre>'
    	/opt/bin/ipkg -force-defaults install "${PACKAGE}" </dev/null
    	echo '</pre>'
    fi
    
    if [ "${TASK}" = update ]
    then
    	echo "<h2>Update ${PACKAGE}</h2>"
    	echo '<pre>'
    	/opt/bin/ipkg -force-defaults upgrade "${PACKAGE}" </dev/null
    	echo '</pre>'
    fi
    
    if [ "${TASK}" = delete ]
    then
    	echo "<h2>Delete ${PACKAGE}</h2>"
    	echo '<pre>'
    	/opt/bin/ipkg -force-defaults remove "${PACKAGE}" </dev/null
    	echo '</pre>'
    fi
    
    if [ "${SUBMIT}" != ""  ]
    then
    	echo '<h2>Package list</h2>'
    	/opt/bin/ipkg list_installed >${TMPFILE}
    	trap "[ -f ${TMPFILE} ] && rm ${TMPFILE}" 0
    
    	echo '<table border="1" cellpadding="0" cellspacing="0">'
    	echo '<tr><th>task</th><th>Package</th><th>I-Ver</th><th>P-Ver</th><th>Comment</th><th>Delete</th></tr>'
    	/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)
    				[ -z "${INSTALLED}" ] && SHOW=1
    				;;
    			*)
    				echo "<b>ERROR</b>: Unkown typefilter '${TYPEFILTER}'"
    				echo '</body>'
    				echo '</html>'
    				exit 1
    				;;
    		esac
    		[ "${SHOW}" = 1 ] && echo "<tr><td>${TASK}</td><td>${NAME}</td><td>${IVER}</td><td>${VERSION}</td><td>${COMMENT}</td><td>${DEL}</td></tr>"
    	done
    	echo '</table>'
    fi
    
    echo '</body>'
    echo '</html>'
    Gruß FastJack
    Last edited by FastJack; 31-03-2008 at 13:40.

Page 3 of 5 FirstFirst 12345 LastLast

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
  •