#! /bin/bash

# Simple code to install rpm packages 
# outside from our repositories, with
# with check of dependencies
if [ $# -eq 0 ];
then
usage
fi
#
OPEN1="$1"
#
if [ -f /usr/bin/dnf ];then
	if [ `echo $OPEN1 | sed -e '{s/64_86//;s/.noarch.rpm//}'` -eq `rpm -qpl --queryformat 'Name' $OPEN1` ]; then
		xterm -hold -e "su -c 'dnf reinstall $OPEN1 '"
	else	
		xterm -hold -e "su -c 'dnf install $OPEN1 '"
	fi	
else
	xterm -hold -e "su -c 'apt-get install $OPEN1 '"
fi
exit 0
