You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kdpkg/kdpkg-install/sh/kdpkg-sh

48 lines
930 B

#!/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