forked from ojaksch/MiSTer_update_tty2xxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_tty2xxx.sh
67 lines (54 loc) · 2.24 KB
/
update_tty2xxx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
[ -e /media/fat/Scripts/update_tty2xxx_system.ini ] && . /media/fat/Scripts/update_tty2xxx_system.ini
[ -e /media/fat/Scripts/update_tty2xxx_user.ini ] && . /media/fat/Scripts/update_tty2xxx_user.ini
CORENAME=$(</tmp/CORENAME)
echo "000-UPDATE" > /tmp/CORENAME
runupdate() {
[ "${CLEAR}" = "yes" ] && clear
echo -e "${fyellow}${fblink}${fbold}RUNNING ${1}${freset}"
"${SCRIPTPATH}/${1}"
if [ "${PAUSE}" = "yes" ]; then
echo -e "${fyellow}${fblink}${fbold}Press ENTER to continue.${freset}"
read dummy
fi
}
# Update the updater if neccessary
wget ${NODEBUG} --no-cache "${REPOSITORY_URL}/update_tty2xxx.sh" -O /tmp/update_tty2xxx.sh
cmp -s /tmp/update_tty2xxx.sh ${SCRIPTPATH}/update_tty2xxx.sh
if [ "${?}" -gt "0" ] && [ -s /tmp/update_tty2xxx.sh ]; then
echo -e "${fyellow}Downloading Updater-Update ${fmagenta}${freset}"
mv -f /tmp/update_tty2xxx.sh ${SCRIPTPATH}/update_tty2xxx.sh
exec ${SCRIPTPATH}/update_tty2xxx.sh
exit 255
else
rm /tmp/update_tty2xxx.sh
fi
# Check and update INI files if neccessary
! [ -e ${SCRIPTPATH}/update_tty2xxx_user.ini ] && touch ${SCRIPTPATH}/update_tty2xxx_user.ini
wget ${NODEBUG} --no-cache "${REPOSITORY_URL}/update_tty2xxx_system.ini" -O /tmp/update_tty2xxx_system.ini
cmp -s /tmp/update_tty2xxx_system.ini "${SCRIPTPATH}/update_tty2xxx_system.ini"
if [ "${?}" -gt "0" ]; then
mv /tmp/update_tty2xxx_system.ini "${SCRIPTPATH}/update_tty2xxx_system.ini"
. ${SCRIPTPATH}/update_tty2xxx_system.ini
. ${SCRIPTPATH}/update_tty2xxx_user.ini
fi
if [ "${i2c2oled}" = "yes" ] && [ -e ${SCRIPTPATH}/update_i2c2oled.sh ]; then
runupdate update_i2c2oled.sh
fi
if [ "${tty2oled}" = "yes" ] && [ -e ${SCRIPTPATH}/update_tty2oled.sh ]; then
runupdate update_tty2oled.sh
fi
if [ "${tty2tft}" = "yes" ] && [ -e ${SCRIPTPATH}/update_tty2tft.sh ]; then
runupdate update_tty2tft.sh
fi
if [ "${tty2rpi}" = "yes" ] && [ -e ${SCRIPTPATH}/update_tty2rpi.sh ]; then
runupdate update_tty2rpi.sh
fi
if [ "${tty2rgb}" = "yes" ] && [ -e ${SCRIPTPATH}/update_tty2rgb.sh ]; then
runupdate update_tty2rgb.sh
fi
if [ "${update_all}" = "yes" ] && [ -e ${SCRIPTPATH}/update_all.sh ]; then
runupdate update_all.sh
fi
echo -e "${fyellow}Done...Have fun!${fmagenta}${freset}"
echo "${CORENAME}" > /tmp/CORENAME