forked from fairbird/RaedQuickSignal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
172 lines (163 loc) · 6.69 KB
/
installer.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/bin/bash
##setup command=wget -q "--no-check-certificate" https://raw.githubusercontent.com/fairbird/RaedQuickSignal/main/installer.sh -O - | /bin/sh
######### Only These two lines to edit with new version ######
version=16.6
description=What is NEW:\n- Add Slovak language support\n\n*************************\n:ما هو الجديد\n- إضافة دعم اللغة السلوفاكية
##############################################################
BACKUPPATH=/tmp/Backup
PLUGINPICONTMPPATH=/tmp/RaedQuickSignal
if [ ! -d /usr/lib64 ]; then
PLUGINPATH=/usr/lib/enigma2/python/Plugins/Extensions/RaedQuickSignal
else
PLUGINPATH=/usr/lib64/enigma2/python/Plugins/Extensions/RaedQuickSignal
fi
# check depends packges
if [ -f /var/lib/dpkg/status ]; then
STATUS=/var/lib/dpkg/status
OSTYPE=DreamOs
else
STATUS=/var/lib/opkg/status
OSTYPE=Dream
fi
echo ""
if python --version 2>&1 | grep -q '^Python 3\.'; then
echo "You have Python3 image"
PYTHON=PY3
Packagesix=python3-six
Packagerequests=python3-requests
else
echo "You have Python2 image"
PYTHON=PY2
Packagerequests=python-requests
fi
if [ $PYTHON = "PY3" ]; then
if grep -qs "Package: $Packagesix" cat $STATUS ; then
echo ""
else
opkg update && opkg install python3-six
fi
fi
echo ""
if grep -qs "Package: $Packagerequests" cat $STATUS ; then
echo ""
else
echo "Need to install $Packagerequests"
echo ""
if [ $OSTYPE = "DreamOs" ]; then
apt-get update && apt-get install python-requests -y
elif [ $PYTHON = "PY3" ]; then
opkg update && opkg install python3-requests
elif [ $PYTHON = "PY2" ]; then
opkg update && opkg install python-requests
fi
fi
echo ""
## Remove old file from tmp directory
[ -d $BACKUPPATH ] && rm -rf $BACKUPPATH
[ -d $PLUGINPICONTMPPATH ] && rm -rf $PLUGINPICONTMPPATH > /dev/null 2>&1
[ -r /tmp/RaedQuickSignal-"$version".tar.gz ] && rm -f /tmp/RaedQuickSignal-"$version".tar.gz > /dev/null 2>&1
[ -r /tmp/RaedQuickServName2-dreamos.tar.gz ] && rm -f /tmp/RaedQuickServName2-dreamos.tar.gz > /dev/null 2>&1
### backup Current files/Folders and save it beffore delete old version of plugin
mkdir -p $BACKUPPATH
[ -r $PLUGINPATH/tools/keymap.xml ] && cp -f $PLUGINPATH/tools/keymap.xml $BACKUPPATH/keymap.xml > /dev/null 2>&1
[ -d $PLUGINPATH/PICONS/emu ] && cp -r $PLUGINPATH/PICONS/emu $BACKUPPATH > /dev/null 2>&1
[ -d $PLUGINPATH/PICONS/piconSat ] && cp -r $PLUGINPATH/PICONS/piconSat $BACKUPPATH > /dev/null 2>&1
[ -d $PLUGINPATH/PICONS/piconProv ] && cp -r $PLUGINPATH/PICONS/piconProv $BACKUPPATH > /dev/null 2>&1
[ -d $PLUGINPATH/PICONS/piconCrypt ] && cp -r $PLUGINPATH/PICONS/piconCrypt $BACKUPPATH > /dev/null 2>&1
[ -d $PLUGINPATH/PICONS/weather ] && cp -r $PLUGINPATH/PICONS/weather $BACKUPPATH > /dev/null 2>&1
[ -r $PLUGINPATH ] && rm -rf $PLUGINPATH
# Download and install plugin + converter files
# check depends packges
cd /tmp
set -e
rm -rf *RaedQuickSignal* > /dev/null 2>&1
if [ -f /var/lib/dpkg/status ]; then
echo "# Your image is OE2.5/2.6 #"
echo ""
echo ""
cd /tmp
wget https://github.com/fairbird/RaedQuickSignal/archive/refs/heads/main.tar.gz
tar -xzf main.tar.gz
cp -r 'RaedQuickSignal-main/usr' '/'
cp -r 'RaedQuickSignal-main/tmp/RaedQuickSignal' '/tmp'
wget https://github.com/fairbird/RaedQuickSignal/raw/main/RaedQuickServName2-dreamos.tar.gz
if [ -f '/tmp/RaedQuickServName2-dreamos.tar.gz' ]; then
rm -f /usr/lib/enigma2/python/Components/Converter/RaedQuickServName2.py > /dev/null 2>&1
fi
tar -xzf RaedQuickServName2-dreamos.tar.gz -C /
else
echo "# Your image is OE2.0 #"
echo ""
echo ""
wget https://github.com/fairbird/RaedQuickSignal/archive/refs/heads/main.tar.gz
tar -xzf main.tar.gz
cp -r 'RaedQuickSignal-main/usr' '/'
cp -r 'RaedQuickSignal-main/tmp/RaedQuickSignal' '/tmp'
fi
set +e
cd ..
sleep 2
### Check if plugin installed correctly
if [ ! -d $PLUGINPATH ]; then
echo "Some thing wrong .. Plugin not installed"
exit 1
fi
mkdir -p $PLUGINPATH/PICONS
### move backup files/Folders save to plugin
[ -r $BACKUPPATH/keymap.xml ] && mv $BACKUPPATH/keymap.xml $PLUGINPATH/tools > /dev/null 2>&1
[ -d $BACKUPPATH/emu ] && mv $BACKUPPATH/emu $PLUGINPATH/PICONS > /dev/null 2>&1
[ -d $BACKUPPATH/piconSat ] && mv $BACKUPPATH/piconSat $PLUGINPATH/PICONS > /dev/null 2>&1
[ -d $BACKUPPATH/piconProv ] && mv $BACKUPPATH/piconProv $PLUGINPATH/PICONS > /dev/null 2>&1
[ -d $BACKUPPATH/piconCrypt ] && mv $BACKUPPATH/piconCrypt $PLUGINPATH/PICONS > /dev/null 2>&1
[ -d $BACKUPPATH/weather ] && mv $BACKUPPATH/weather $PLUGINPATH/PICONS > /dev/null 2>&1
### Checking if picons folder avinable on plugin
if [ ! -d $PLUGINPATH/PICONS/emu ]; then
echo "Missing emu folder will be send it to plugin path"
cp -r $PLUGINPICONTMPPATH/emu $PLUGINPATH/PICONS > /dev/null 2>&1
else
cp -u $PLUGINPICONTMPPATH/emu/* $PLUGINPATH/PICONS/emu > /dev/null 2>&1
fi
if [ ! -d $PLUGINPATH/PICONS/piconProv ]; then
echo "Missing piconProv folder will be send it to plugin path"
cp -r $PLUGINPICONTMPPATH/piconProv $PLUGINPATH/PICONS > /dev/null 2>&1
else
cp -u $PLUGINPICONTMPPATH/piconProv/* $PLUGINPATH/PICONS/piconProv > /dev/null 2>&1
fi
if [ ! -d $PLUGINPATH/PICONS/piconSat ]; then
echo "Missing piconSat folder will be send it to plugin path"
cp -r $PLUGINPICONTMPPATH/piconSat $PLUGINPATH/PICONS > /dev/null 2>&1
else
cp -u $PLUGINPICONTMPPATH/piconSat/* $PLUGINPATH/PICONS/piconSat > /dev/null 2>&1
fi
if [ ! -d $PLUGINPATH/PICONS/piconCrypt ]; then
echo "Missing piconCrypt folder will be send it to plugin path"
cp -r $PLUGINPICONTMPPATH/piconCrypt $PLUGINPATH/PICONS > /dev/null 2>&1
else
cp -u $PLUGINPICONTMPPATH/piconCrypt/* $PLUGINPATH/PICONS/piconCrypt > /dev/null 2>&1
fi
if [ ! -d $PLUGINPATH/PICONS/weather ]; then
echo "Missing weather folder will be send it to plugin path"
cp -r $PLUGINPICONTMPPATH/weather $PLUGINPATH/PICONS > /dev/null 2>&1
else
cp -u $PLUGINPICONTMPPATH/weather/* $PLUGINPATH/PICONS/weather > /dev/null 2>&1
fi
rm -rf /tmp/*RaedQuickSignal* > /dev/null 2>&1
rm -rf /tmp/*main* > /dev/null 2>&1
rm -rf $PLUGINPICONTMPPATH > /dev/null 2>&1
rm -rf $BACKUPPATH > /dev/null 2>&1
rm -f /tmp/RaedQuickSignal-"$version".tar.gz > /dev/null 2>&1
rm -f /tmp/RaedQuickServName2-dreamos.tar.gz > /dev/null 2>&1
sync
echo ""
echo ""
echo "#########################################################"
echo "# RaedQuickSignal INSTALLED SUCCESSFULLY #"
echo "# Raed (fairbird) #"
echo "# support #"
echo "# https://www.tunisia-sat.com/forums/threads/2890989 #"
echo "#########################################################"
echo "# your Device will RESTART Now #"
echo "#########################################################"
sleep 3
killall -9 enigma2
exit 0