crossmobile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/sh
  2. APP=crossmobile
  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/crossmob/CrossMobile/releases/latest | grep -E '/.*/.*/.*aarch64.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 "cd /opt/$APP" /usr/local/bin/$APP
  26. echo 'version0=$(cat /opt/$APP/version)
  27. url=https://github.com/crossmob/CrossMobile/releases/latest' >> /opt/$APP/AM-updater
  28. echo 'if curl -L -s $url | grep -ioF "$version0"; then' >> /opt/$APP/AM-updater
  29. echo ' echo "Update not needed!".' >> /opt/$APP/AM-updater
  30. echo 'else' >> /opt/$APP/AM-updater
  31. echo " notify-send 'A new version of $APP is available, please wait'" >> /opt/$APP/AM-updater
  32. echo " mkdir /opt/$APP/tmp
  33. cd /opt/$APP/tmp" >> /opt/$APP/AM-updater
  34. ########################################################################################
  35. function1='$(wget https://github.com/crossmob/CrossMobile/releases/latest -O -'
  36. function2="grep -E '/.*/.*/.*aarch64.appimage' -o)"
  37. function3='$(ls /opt/$APP/tmp)'
  38. echo " wget https://github.com/$function1 | $function2
  39. version=$function3" >> /opt/$APP/AM-updater
  40. ########################################################################################
  41. echo ' cd ..
  42. if test -f ./tmp/*mage; then rm ./version
  43. fi
  44. echo "$version" >> ./version' >> /opt/$APP/AM-updater
  45. echo " mv ./tmp/*mage ./$APP
  46. chmod a+x /opt/$APP/$APP
  47. rmdir ./tmp
  48. fi" >> /opt/$APP/AM-updater
  49. chmod a+x /opt/$APP/AM-updater
  50. # LAUNCHER
  51. rm -f /usr/local/share/applications/$APP-AM.desktop
  52. echo "[Desktop Entry]
  53. Name=CrossMobile
  54. Exec=crossmobile
  55. Comment=COMMENT
  56. Icon=/opt/$APP/$APP.svg
  57. Type=Application
  58. Categories=Development;" >> /usr/local/share/applications/$APP-AM.desktop
  59. # ICON
  60. wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/programs/.icons/$APP/$APP.svg