-
Notifications
You must be signed in to change notification settings - Fork 6
/
install.sh
executable file
·154 lines (134 loc) · 5.68 KB
/
install.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/sh
#wget -q "--no-check-certificate" https://raw.githubusercontent.com/ziko-ZR1/FootOnsat/main/Download/install.sh -O - | /bin/sh
VERSION=1.7
PLUGIN_PATH='/usr/lib/enigma2/python/Plugins/Extensions/FootOnSat'
DB_PATH='/usr/lib/enigma2/python/Plugins/Extensions/FootOnSat/db'
TMP_DB='/tmp/footonsat.db'
if [ -f /etc/apt/apt.conf ] ; then
STATUS='/var/lib/dpkg/status'
OS='DreamOS'
VERSION=1.6
elif [ -f /etc/opkg/opkg.conf ] ; then
STATUS='/var/lib/opkg/status'
OS='Opensource'
fi
if [ -d $PLUGIN_PATH ]; then
if [ -f '/usr/lib/enigma2/python/Plugins/Extensions/FootOnSat/db/footonsat.db' ]; then
echo "Keep old db...."
cp -a /usr/lib/enigma2/python/Plugins/Extensions/FootOnSat/db/footonsat.db /tmp
fi
echo "Remove old version."
if [ $OS = "Opensource" ]; then
opkg remove enigma2-plugin-extensions-footonsat
else
apt-get purge --auto-remove enigma2-plugin-extensions-footonsat
fi
fi
if python --version 2>&1 | grep -q '^Python 3\.'; then
echo "You have Python3 image"
PYTHON='PY3'
SQLITE3='python3-sqlite3'
PYSIX='python3-six'
else
echo "You have Python2 image"
PYTHON='PY2'
SQLITE3='python-sqlite3'
PYSIX='python-six'
fi
if grep -q $SQLITE3 $STATUS; then
sqlite='Installed'
fi
if grep -q $PYSIX $STATUS; then
six='Installed'
fi
if grep -q 'alsa-utils-aplay' $STATUS; then
aplay='Installed'
fi
if [ $sqlite = "Installed" -a $six = "Installed" -a $aplay = "Installed" ]; then
echo ""
else
if [ $OS = "Opensource" ]; then
echo "=========================================================================="
echo "Some Depends Need to Be downloaded From Feeds ...."
echo "=========================================================================="
echo "Opkg Update ..."
echo "========================================================================"
opkg update
echo "========================================================================"
echo " Downloading alsa-utils-aplay ......"
opkg install alsa-utils-aplay
echo "========================================================================"
echo "========================================================================"
echo " Downloading $SQLITE3 , $PYSIX ......"
opkg install $SQLITE3
echo "========================================================================"
opkg install $PYSIX
echo "========================================================================"
else
echo "=========================================================================="
echo "Some Depends Need to Be downloaded From Feeds ...."
echo "=========================================================================="
echo "apt Update ..."
echo "========================================================================"
apt-get update
echo "========================================================================"
echo " Downloading alsa-utils-aplay ......"
apt-get install alsa-utils-aplay -y
echo "========================================================================"
echo "========================================================================"
echo " Downloading $SQLITE3 , $PYSIX ......"
apt-get install $SQLITE3 -y
echo "========================================================================"
apt-get install $PYSIX -y
echo "========================================================================"
fi
fi
if grep -q 'alsa-utils-aplay' $STATUS; then
echo ""
else
echo "#########################################################"
echo "# alsa-utils-aplay Not found in feed #"
echo "# Notification sound will not work without alsa aplay #"
echo "#########################################################"
fi
if grep -q $SQLITE3 $STATUS; then
echo ""
else
echo "#########################################################"
echo "# $SQLITE3 Not found in feed #"
echo "#########################################################"
exit 1
fi
if grep -q $PYSIX $STATUS; then
echo ""
else
echo "#########################################################"
echo "# $PYSIX Not found in feed #"
echo "#########################################################"
exit 1
fi
if [ $OS = "Opensource" ]; then
wget "--no-check-certificate" "https://github.com/ziko-ZR1/FootOnsat/blob/main/Download/enigma2-plugin-extensions-footonsat_$VERSION.ipk?raw=true" -O "/tmp/enigma2-plugin-extensions-footonsat_$VERSION.ipk";
opkg install /tmp/enigma2-plugin-extensions-footonsat_$VERSION.ipk
rm -f /tmp/enigma2-plugin-extensions-footonsat_$VERSION.ipk
else
wget "--no-check-certificate" "https://github.com/ziko-ZR1/FootOnsat/blob/main/Download/enigma2-plugin-extensions-footonsat_$VERSION.deb?raw=true" -O "/tmp/enigma2-plugin-extensions-footonsat_$VERSION.deb";
dpkg -i --force-overwrite /tmp/enigma2-plugin-extensions-footonsat_$VERSION.deb; apt-get install -f -y
rm -f /tmp/enigma2-plugin-extensions-footonsat_$VERSION.deb
fi
if [ -d $PLUGIN_PATH ]; then
if [ -f $TMP_DB ]; then
cp -a $TMP_DB $DB_PATH
rm -f $TMP_DB
fi
fi
echo ""
echo "#########################################################"
echo "# FootOnsat INSTALLED SUCCESSFULLY #"
echo "# BY ZIKO & Redouane #"
echo "#########################################################"
echo "# Restart Enigma2 GUI #"
echo "#########################################################"
sleep 2
killall -9 enigma2
exit 0