#!/bin/sh export DATE="14.9.2008";SCRIPT=${0#/rom} export TITLE="Amministrazione: Software 2" . ${SCRIPT%/*}/cgi-bin-pre.sh cat<Amministrazione: Software 2 EOF if [ "(ro)" != "$(mount|grep " / "|if read line; then set $line;echo $6;fi)" ]; then if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ -z "$QUERY_STRING" ]; then installed_packages=`cat /usr/lib/ipkg/status | sed -e '/^$/d' -e '/^\(Root\|Version\|Conffiles\)/d' -e 's/\(Package\|Status\):\ //g' -e 's/[\ ]*//g' -e '/^\('$system_packages'\)$/,/install/ d'` cat<
Packet Name Action
EOF last_package="" found_installed_packages="" for package in $installed_packages; do if [ "$last_package" ]; then if [ "$package" = "installokinstalled" ]; then found_installed_packages="$found_installed_packages\|$last_package" cat<
$last_package EOF fi last_package="" else last_package=$package fi done available_packages=`ipkg list | sed -e 's/\([^\ ]\)[\ \-\ ].*/\1/g' -e '/^\('$system_packages$found_installed_packages'\)$/ d'` for package in $available_packages;do cat<
$package EOF done cat<

Update List

EOF else if [ "`echo $QUERY_STRING | grep install`" ]; then IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $* eval "package=\$install" package=$(httpd -d "$package") echo "
"
ipkg install $package
echo "
" cat<Back

EOF elif [ "`echo $QUERY_STRING | grep remove`" ];then IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $* eval "package=\$remove" package=$(httpd -d "$package") echo "
"
ipkg remove $package
echo "
" cat<Back

EOF else echo "
"
ipkg update
echo "
" cat<Back

EOF fi fi else cat< It is not possible to install or remove additional software packages when in Failsafe or Readonly mode. On the Restart page, activate the Normal restart option and confirm with Restart. EOF fi . ${SCRIPT%/*}/cgi-bin-post.sh