antares 2.3 KB

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