source: branches/whiterussian/openwrt/package/webif/files/www/cgi-bin/webif/ipkg.sh @ 3466

Last change on this file since 3466 was 3466, checked in by nbd, 11 years ago

add missing translation symbol

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1#!/usr/bin/webif-page
2<?
3. /usr/lib/webif/webif.sh
4header "System" "Installed Software" "@TR<<Installed Software>>"
5?>
6<p style="position: absolute; right: 1em; top: 10.5em"><a href="ipkg.sh?action=update">@TR<<Update package lists>></a></p>
7<pre><?
8if [ "$FORM_action" = "update" ]; then
9        ipkg update
10elif [ "$FORM_action" = "install" ]; then
11        yes n | ipkg install `echo "$FORM_pkg" | sed -e 's, ,+,g'`
12elif [ "$FORM_action" = "remove" ]; then
13        ipkg remove `echo "$FORM_pkg" | sed -e 's, ,+,g'`
14fi
15?></pre>
16<div class="half noBorderOnLeft">
17  <h3>@TR<<Installed Packages>></h3>
18  <table style="width: 90%">
19<?
20ipkg list_installed | awk -F ' ' '
21$2 !~ /terminated/ {
22        link=$1
23        gsub(/\+/,"%2B",link)
24        print "<tr><td>" $1 "</td><td><a href=\"ipkg.sh?action=remove&pkg=" link "\">@TR<<Uninstall>></td></tr>"
25}
26'
27?>
28  </table>
29</div>
30<div class="half noBorderOnLeft">
31  <h3>@TR<<Available packages>></h3>
32  <table style="width: 90%">
33<?
34grep Package: /usr/lib/ipkg/status /usr/lib/ipkg/lists/* 2>&- | sed -e 's, ,,' -e 's,/usr/lib/ipkg/lists/,,' | awk -F: '
35$1 ~ /status/ {
36        installed[$3]++;
37}
38($1 !~ /terminated/) && ($1 !~ /\/status/) && (!installed[$3]) {
39        if (current != $1) print "<tr><th>" $1 "</th><td></td></tr>"
40        link=$3
41        gsub(/\+/,"%2B",link)
42        print "<tr><td>" $3 "</td><td><a href=\"ipkg.sh?action=install&pkg=" link "\">@TR<<Install>></td></tr>"
43        current=$1
44}
45'
46?>
47  </table>
48</div>
49
50<div class="rowOfBoxes"></div>
51         
52<? footer ?>
53<!--
54##WEBIF:name:System:3:Installed Software
55-->
Note: See TracBrowser for help on using the repository browser.