#LOOSERHELPER
NotRoot="ERROR:  NEM vagy Rendszer-administrator (root)!. Ez a helper csak Root[admin] jogokkal fut!"
if [ "$UID" != 0 ];then echo "$NotRoot" ; sleep 6 && exit ;fi
linux_logo
VERSION=$(lsb_release -rs | sed 's|\..*|.x|')
VERSION="18.x"
if [ ! -n "$VERSION" ];then echo "HIBA: Verzió nem érhető el:(" ; sleep 6 && exit ;fi
echo "blackPanther OS verzió: $VERSION"
curl --silent --retry 3 --retry-max-time 30 --connect-timeout 5 --max-time 10 https://ftp.linux.cz/pub/linux/blackpantheros/All/v$VERSION/64bit/updates/repodata/repomd.xml -o /tmp/repotest
if [ ! -n "$(grep repomd /tmp/repotest 2>/dev/null)" ]; then echo "Hiba: a mirror nem érhető el!" ; sleep 6 && exit 0; fi
[ -f "/tmp/repotest" ]&&rm -f /tmp/repotest
rm -f /etc/urpmi/urpmi.cfg && cp -f /etc/urpmi/mirrors/linux.cz /etc/urpmi/urpmi.cfg
rm -f /etc/yum.repos.d/System.repo && cp -f /etc/yum.repos.d/mirrors/linux.cz.repo /etc/yum.repos.d/System.repo
echo -e "Az IMS kézi módba váltott egy HTTP szerverre!"
sleep 5
echo
echo -e "Megpróbálom ezzel firssíteni a tárolókat!"
up="frissites forrasok --kenyszeritve"
if [ ! -n "$(which frissites 2>/dev/null)" ];then up="pkcon refresh cache -c 1" ;fi
linux_logo
$up
linux_logo
up2=frissites
if [ ! -n "$(which frissites 2>/dev/null)" ];then pkcon -y get-updates ;fi
$up2
echo
echo "Minden kész!"
echo
sleep 2
echo "Hasznos tartalmakért látogass el hozzánk: blackpanther.hu"
sleep 5
echo "Viszlát!"
sleep 2

