/
conty-wine
51 lines (41 loc) · 1.23 KB
/
conty-wine
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
#!/bin/sh
APP=conty-wine
REPO="Kron4ek/Conty"
version=$(curl -Ls https://api.github.com/repos/$REPO/releases | jq '.' | grep -w -v zsync | grep browser_download_url | grep -i "conty_wine.sh" | cut -d '"' -f 4 | head -1)
# CREATE THE FOLDER
mkdir /opt/$APP
cd /opt/$APP
# ADD THE REMOVER
echo '#!/bin/sh' >> /opt/$APP/remove
echo "rm -R -f /usr/share/applications/AM-$APP.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove
chmod a+x /opt/$APP/remove
# DOWNLOAD THE APPIMAGE
mkdir tmp
wget $version -O $APP
cd tmp
wget $version.zsync 2> /dev/null
cd ..
chmod a+x /opt/$APP/$APP
mv ./tmp/*.zsync ./$APP.zsync 2> /dev/null
rmdir ./tmp
echo $version >> ./version
# LINK
ln -s /opt/$APP/$APP /usr/local/bin/$APP
# SCRIPT TO UPDATE THE PROGRAM
cat >> /opt/$APP/AM-updater << 'EOF'
#!/bin/sh
APP=conty-wine
REPO="Kron4ek/Conty"
version=$(curl -Ls https://api.github.com/repos/$REPO/releases | jq '.' | grep -w -v zsync | grep browser_download_url | grep -i "conty_wine.sh" | cut -d '"' -f 4 | head -1)
cd /opt/$APP
mkdir tmp
cd ./tmp
wget $version.zsync 2> /dev/null
cd ..
mv ./tmp/*.zsync ./$APP.zsync
rmdir ./tmp
zsync /opt/$APP/$APP.zsync
rm -R -f /opt/$APP/*zs-old /opt/$APP/*.part
chmod a+x /opt/$APP/$APP
EOF
chmod a+x /opt/$APP/AM-updater