#!/bin/dash
if [ $(id -u) -ne 0 ]; then
	Xdialog --title "Error!" --infobox "Only root can install packages." 0 0 10000
	exit
fi
if Xdialog --title "Install Package" --yesno "Are you sure you want to install ${1##*/}?" 0 0; then
	Xdialog --no-buttons --title "Installing" -infobox "Installing ${1##*/}, please wait ..." 0 0 1000000 &
	XPID=$!
	if installpkg "$1"; then
		kill $XPID
		Xdialog --infobox "${1##*/} installed successfully." 0 0 10000
	else
		kill $XPID
		Xdialog --infobox "${1##*/} failed to install." 0 0 10000
	fi
fi

