Files
neoboot/iNB.sh

82 lines
3.0 KiB
Bash
Raw Normal View History

2021-02-09 12:56:45 +02:00
#!/bin/sh
#
#skrypt instaluje neoboot-a
#
if `grep -q 'osd.language=pl_PL' </etc/enigma2/settings`; then
PL=1
fi
2021-12-06 12:09:40 +02:00
if [ -f /etc/apt/apt.conf ] ; then
STATUS='/var/lib/dpkg/status'
OS='DreamOS'
elif [ -f /etc/opkg/opkg.conf ] ; then
STATUS='/var/lib/opkg/status'
OS='Opensource'
fi
2021-02-09 12:56:45 +02:00
[ -e /tmp/neoboot.zip ] && rm -f /tmp/neoboot.zip
2021-02-09 13:05:23 +02:00
[ -e /tmp/neoboot-main ] && rm -rf /tmp/neoboot-main
2021-02-09 12:56:45 +02:00
[ $PL ] && echo "Pobieranie archiwum..." || echo "Downloading archive file..."
2021-02-12 16:22:11 +02:00
URL='https://github.com/gutosie/neoboot/archive/main.zip'
2021-02-09 12:56:45 +02:00
curl -kLs $URL -o /tmp/neoboot.zip
2021-12-06 11:52:52 +02:00
Cel="/usr/lib/enigma2/python/Plugins/Extensions"
if [ -e $Cel/NeoBoot/plugin.py ]; then
2022-02-23 09:16:41 +02:00
chattr -i /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/plugin.py; chattr -i /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/plugin.pyo
2021-12-06 11:52:52 +02:00
fi
2022-01-30 22:26:17 +02:00
if [ -e /usr/lib/periodon/.activatedmac ]; then
2022-02-23 09:16:41 +02:00
chattr -i /usr/lib/periodon/.activatedmac; rm -f /usr/lib/periodon/.activatedmac
2022-01-30 22:26:17 +02:00
fi
2021-02-09 12:56:45 +02:00
cd /tmp/
2021-03-06 14:58:47 +02:00
#pobieranie
2021-02-22 12:28:49 +02:00
if [ ! -e /tmp/neoboot.zip ]; then
2021-02-14 22:18:30 +02:00
wget --no-check-certificate $URL
mv -f /tmp/main.zip /tmp/neoboot.zip
fi
2021-02-22 12:28:49 +02:00
if [ ! -e /tmp/neoboot.zip ]; then
2021-02-14 22:18:30 +02:00
fullwget --no-check-certificate $URL
2021-02-09 13:07:25 +02:00
mv -f /tmp/main.zip /tmp/neoboot.zip
2021-02-09 12:56:45 +02:00
fi
unzip -qn ./neoboot.zip
rm -f /tmp/neoboot.zip
2021-02-09 13:20:54 +02:00
[ -e /tmp/main.zip ] && rm -rf /tmp/main.zip
2022-02-25 09:27:43 +02:00
BOXHOSTNAME=$( cat /etc/hostname)
2022-02-25 09:39:51 +02:00
if [ $BOXHOSTNAME = "dm500hd" ] || [ $BOXHOSTNAME = "dm800se" ] || [ $BOXHOSTNAME = "dm800" ] || [ $BOXHOSTNAME = "dm8000" ]; then
2022-02-25 09:35:20 +02:00
cp -af /tmp/neoboot-main/NeoBoot/tmpfiles/runpy/mips_run.py /tmp/neoboot-main/NeoBoot/run.py; rm -r /tmp/neoboot-main/NeoBoot/ubi_reader*; rm -r /tmp/neoboot-main/NeoBoot/tmpfiles; rm -r /tmp/neoboot-main/NeoBoot/bin/neoinitar*; rm -r /tmp/neoboot-main/NeoBoot/bin/nanddump*; rm -r /tmp/neoboot-main/NeoBoot/bin/fbcle*
2022-02-25 09:27:43 +02:00
fi
2021-02-09 12:56:45 +02:00
#kopiowanie
2021-03-06 14:58:47 +02:00
if [ -e $Cel/NeoBoot/.location ]; then
rm -rf $Cel/NeoBoot/.location
fi
[ $PL ] && echo "Instalowanie..." || echo "Instaling..."
2021-02-09 12:56:45 +02:00
[ -e $Cel/NeoBoot ] && rm -rf $Cel/NeoBoot/* || mkdir -p $Cel/NeoBoot
2021-02-12 14:28:58 +02:00
mv -f /tmp/neoboot-main/NeoBoot/files/testinout /usr/lib/enigma2/python/Tools/Testinout.py
2021-02-22 10:54:05 +02:00
mkdir -p /usr/lib/periodon
2021-02-09 13:05:23 +02:00
mv -f /tmp/neoboot-main/NeoBoot/* $Cel/NeoBoot
[ -e /tmp/neoboot-main ] && rm -rf /tmp/neoboot-main
2021-02-09 12:56:45 +02:00
cd $Cel/NeoBoot
chmod 755 ./bin/*
chmod 755 ./ex_init.py
chmod 755 ./files/*.sh
2021-02-09 13:20:54 +02:00
chmod -R +x ./ubi_reader_arm/*
chmod -R +x ./ubi_reader_mips/*
2022-02-25 09:27:43 +02:00
chattr +i /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/plugin.py
2021-02-09 12:56:45 +02:00
if [ $PL ] ; then
echo ""
echo "#####################################################"
2021-02-12 16:22:11 +02:00
echo "# NEOBOOT ZOSTAL ZAINSTALOWANY #"
2021-02-09 12:56:45 +02:00
echo "#####################################################"
echo ""
else
echo ""
echo "#####################################################"
2021-12-24 22:46:25 +02:00
echo "# >>> NEOBOOT INSTALLED SUCCESSFULLY <<< #"
2021-02-09 12:56:45 +02:00
echo "#####################################################"
echo ""
fi
2021-12-06 12:09:40 +02:00
echo " ----- Restart Enigma2 GUI ... ----- "
2021-12-06 12:28:02 +02:00
sleep 2
2021-12-06 12:09:40 +02:00
if [ $OS = 'DreamOS' ]; then
systemctl restart enigma2
else
killall -9 enigma2
fi
2021-02-09 12:56:45 +02:00
exit 0