sample/ 0000777 0000000 0000000 00000000000 11303520003 013211 5 ustar admin administrators sample/sample.sh 0000766 0000000 0000000 00000006102 11316067264 015051 0 ustar admin administrators #!/bin/sh
##################################
#
# ABSTRACT: NPKG script for NMP-1000
#
# HISTORY: << Designers please add your names here >>
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
##################################
#
##################################
# INCLUDE HEADER
##################################
# Load the header file and check if loaded
. /share/OpenNMP/.onmp/header.sh
[ ! -f $USB_BASE/.onmp/header.sh ] && /bin/echo "Header file is missing!" && exit 1
#
##################################
# NPKG
##################################
FILENAME=`$CMD_READLINK -f $0`; FILENAME="${FILENAME##*/}"; NPKG_NAME="${FILENAME%.*}"
NPKG_DIR=$NPKG_INSTALL_PATH/$NPKG_NAME
NPKG_VER="`${CMD_GETCFG} npkg Version -f ${NPKG_DIR}/${NPKG_NAME}.ini`"
#
##################################
# MAIN
##################################
#
$CMD_ECHO -e "> Entering ${FILENAME} ${1}"
case $1 in
# Preinstall is performed while the new NPKG is still in the temporary folder to handle pre-installation operations
preinstall)
# Move Optware preinstallation files if any into the USB device .@preinstall folder
$CMD_ECHO -e "Move IPKG modules to preinstallation folder"
bar $CMD_CP -Rf $USB_BASE/$NPKG_TEMP/$NPKG_NAME/.@preinstall /$USB_BASE
$CMD_RM -Rf $USB_BASE/$NPKG_TEMP/$NPKG_NAME/.@preinstall
# Install required IPKG modules
IPKG_UTILITIES=`$CMD_GETCFG npkg Ipkg -f $USB_BASE/$NPKG_TEMP/$NPKG_NAME/$NPKG_NAME.ini`
install_ipkg "'${IPKG_UTILITIES}'"
# The command line below overwrite previous NPKG files
$CMD_ECHO -e "Copying files..."
bar $CMD_CP -Rf $USB_BASE/$NPKG_TEMP/$NPKG_NAME $NPKG_INSTALL_PATH/
NPKG_INSTALL_MSG="${NPKG_NAME} ${NPKG_VER} successfully preinstalled"; $CMD_ECHO $NPKG_INSTALL_MSG
_exit 0
;;
# Upgrade is performed while the new NPKG is in its final folder
upgrade)
NPKG_INSTALL_MSG="${NPKG_NAME} ${NPKG_VER} successfully upgraded"; $CMD_ECHO $NPKG_INSTALL_MSG
_exit 0
;;
# Install is performed once the NPKG files have been moved (1st install) or copied (upgrade) to their final location
install)
NPKG_INSTALL_MSG="${NPKG_NAME} ${NPKG_VER} successfully installed"; $CMD_ECHO $NPKG_INSTALL_MSG
_exit 0
;;
# Remove is performed before NPKG deletion
remove)
NPKG_INSTALL_MSG="${NPKG_NAME} ${NPKG_VER} successfully removed"; $CMD_ECHO $NPKG_INSTALL_MSG
_exit 0
;;
# Start the NPKG plugin
start)
NPKG_INSTALL_MSG="${NPKG_NAME} ${NPKG_VER} enabled"; $CMD_ECHO $NPKG_INSTALL_MSG
_exit 0
;;
# Stop the NPKG plugin
stop)
NPKG_INSTALL_MSG="${NPKG_NAME} ${NPKG_VER} disabled"; $CMD_ECHO $NPKG_INSTALL_MSG
_exit 0
;;
# Restart the NPKG plugin
restart) ./$0 stop; $CMD_SLEEP 2; ./$0 start
;;
# Usage or wrong parameters has been passed!
*) $CMD_ECHO "USAGE: ${FILENAME} {preinstall|upgrade|install|remove|start|stop|restart}"; exit 1
;;
esac
exit $?
sample/inc/ 0000777 0000000 0000000 00000000000 11275516525 014010 5 ustar admin administrators sample/inc/mnu-sample.php 0000766 0000000 0000000 00000001572 11322410624 016567 0 ustar admin administrators >
- Date:
- version: 1.0
- Description: Sample NPKG Menu
*************************************************************************/
$npkg = "sample";
load_language(".npkg/$npkg/langs/$npkg","menu"); // Load NPKG plugin language strings
// Add Menu entries (Language may need to be re-encoded with some applications)
switch ($lid) {
case "French": $lg = "fr"; break;
case "German": $lg = "de"; break;
default: $lg = "en";
}
echo "
";
?> sample/inc/cfg-sample.php 0000766 0000000 0000000 00000001500 11316067264 016531 0 ustar admin administrators >
- Date:
- version: 1.0
- Description: Sample NPKG configuration
*************************************************************************/
load_language(".npkg/$npkg/langs/$npkg",$npkg); // Load NPKG plugin language strings
// NPKG Configuration page header
$show_enable = true; $show_disable = true; $show_remove = true;
include("npkg_head.php");
// **** Place here below the code for the configuration page ****
echo"