#!/bin/bash # (c) 2010 Timothy Pearson # (c) Fabian Wuertz Feb 2008 if [ "$1" == "update" ]; then apt-get update if [ $? -eq 0 ]; then echo "" echo "Update OK" else echo "" echo "Errors were encountered while updating the package index" echo "Please press enter to continue" read fi fi if [ "$1" == "install" ]; then if [ "$3" != "none" ]; then installPackage=$(echo ${3//","/" "}) apt-get install $installPackage fi if [ "$4" != "none" ]; then removePackage=$(echo ${4//","/" "}) apt-get remove $removePackage fi dpkg -i $2 if [ $? -eq 0 ]; then apt-get install -f if [ $? -eq 0 ]; then echo "" echo "Installation OK" else echo "" echo "Errors were encountered while installing your package" echo "Please press enter to exit" read fi else echo "" echo "Errors were encountered while installing your package" echo "Please press enter to continue" read fi fi