#LOOSERHELPER

linux_logo

NotRoot="ERROR:  NEM vagy Rendszer-administrator. Ez a helper csak Root[admin] jogokkal fut!"
if [ "$UID" != 0 ];then echo "$NotRoot" ; sleep 6 && exit ;fi

echo "blackPanther HP Plugin Helper!"
echo "------------------------------"

HPVER=$(rpm -q --queryformat="%{VERSION}\n" hplip 2>/dev/null)
[ -n "$( echo $HPVER| grep 'not installed')" ]&& echo "HIBA! Nincs telepítve a HPLIP! Telepítsd fel a nyomtatási rendszrrel.." && exit
[ ! -n "$( echo $HPVER| grep '[0-9]')" ]&& echo "HIBA! Nincs telepíŧve a HPLIP" && exit
echo "HPLip veerzió: $HPVER"
sleep 2
echo "Letöltés..."
sleep 1
wget -c https://developers.hp.com/sites/default/files/hplip-${HPVER}-plugin.run
[ ! -f "./hplip-${HPVER}-plugin.run" ]&& echo "HIBA! Nem sikerült letöleni a plugin-t" && exit
chmod +x hplip-${HPVER}-plugin.run
echo
echo "Kicsiomagolás...."
sleep 2
./hplip-${HPVER}-plugin.run --target HPPlugin --keep 2>/dev/null
echo
echo "Plugin beépítés indítása..(várj a megjelenő ablakra!)"
sleep 2
cd HPPlugin || echo ERROR!
python3 ./plugin_install.py
cd ..
echo
echo "Megtisztítás az átmeneti fájloktól...."
rm -rf HPPlugin
rm -f hplip-${HPVER}-plugin.run 

echo
echo "Egy csomó videót, érdekességet találhatsz itt: www.blackpanther.hu"
sleep 5
echo "Minden kész! Ugye nem fájt?! :)))"
echo
sleep 3

