/ programs / aarch64 / antares
antares
 1  #!/bin/sh
 2  
 3  APP=antares
 4  
 5  # CREATE THE FOLDER
 6  mkdir /opt/$APP
 7  cd /opt/$APP
 8  
 9  # ADD THE REMOVER
10  echo '#!/bin/sh' >> /opt/$APP/remove
11  echo "rm -R -f /usr/local/share/applications/$APP-AM.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove
12  chmod a+x /opt/$APP/remove
13  
14  # DOWNLOAD THE APPIMAGE
15  mkdir tmp
16  cd ./tmp
17  
18  wget https://github.com/$(wget https://github.com/Fabio286/antares/releases/latest | grep -E '/.*/.*/.*arm64.AppImage' -o);
19  
20  version=$(ls /opt/$APP/tmp)
21  echo "$version" >> /opt/$APP/version
22  
23  cd ..
24  mv ./tmp/*mage ./$APP
25  chmod a+x /opt/$APP/$APP
26  rmdir ./tmp
27  
28  # LINK
29  ln -s /opt/$APP/$APP /usr/local/bin/$APP
30  
31  # SCRIPT TO UPDATE THE PROGRAM
32  echo '#!/bin/sh' >> /opt/$APP/AM-updater
33  echo "APP=$APP" >> /opt/$APP/AM-updater
34  echo 'version0=$(cat /opt/$APP/version)
35  
36  url=https://github.com/Fabio286/antares/releases/latest' >> /opt/$APP/AM-updater
37  
38  echo 'if curl -L -s $url | grep -ioF "$version0"; then' >> /opt/$APP/AM-updater
39  echo '  echo "Update not needed!".'  >> /opt/$APP/AM-updater
40  echo 'else' >> /opt/$APP/AM-updater
41  echo "  notify-send 'A new version of $APP is available, please wait'" >> /opt/$APP/AM-updater
42  echo "  mkdir /opt/$APP/tmp
43    cd /opt/$APP/tmp" >> /opt/$APP/AM-updater
44  
45  ########################################################################################
46  
47  function1='$(wget https://github.com/Fabio286/antares/releases/latest -O -'
48  function2="grep -E '/.*/.*/.*arm64.AppImage' -o)"
49  function3='$(ls /opt/$APP/tmp)'
50  
51  echo "  wget https://github.com/$function1 | $function2
52    version=$function3" >> /opt/$APP/AM-updater
53  
54  ########################################################################################
55  
56  echo '  cd ..
57    if test -f ./tmp/*mage; then rm ./version
58    fi
59    echo "$version" >> ./version' >> /opt/$APP/AM-updater
60  echo "  mv ./tmp/*mage ./$APP
61    chmod a+x /opt/$APP/$APP
62    rmdir ./tmp
63  fi" >> /opt/$APP/AM-updater
64  chmod a+x /opt/$APP/AM-updater
65  
66  # LAUNCHER
67  rm -f /usr/local/share/applications/$APP-AM.desktop
68  echo "[Desktop Entry]
69  Name=Antares
70  Exec=antares --no-sandbox %U
71  Terminal=false
72  Type=Application
73  Icon=/opt/$APP/$APP.svg
74  StartupWMClass=Antares
75  Comment=A cross-platform easy to use SQL client.
76  Categories=Development;" >> /usr/local/share/applications/$APP-AM.desktop
77  
78  # ICON
79  wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/programs/.icons/$APP/$APP.svg