freac 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/sh
  2. APP=freac
  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/enzo1982/freac/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/enzo1982/freac/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/enzo1982/freac/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=fre:ac
  54. Comment=A free audio converter
  55. Exec=freac %F
  56. Type=Application
  57. Icon=/opt/$APP/$APP.svg
  58. Categories=AudioVideo;Audio;
  59. Keywords=freac;
  60. MimeType=x-content/audio-cdda;application/x-cue;audio/aac;audio/flac;audio/mpeg;audio/mp2;audio/mp4;audio/x-m4b;audio/ogg;audio/x-flac+ogg;audio/x-opus+ogg;audio/x-speex+ogg;audio/x-vorbis+ogg;audio/x-ape;audio/x-musepack;audio/x-wavpack;audio/x-ms-wma;audio/x-aiff;audio/x-voc;audio/x-wav;" >> /usr/local/share/applications/$APP-AM.desktop
  61. # ICON
  62. wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/programs/.icons/$APP/$APP.svg