shashlik-gui.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. # shashlik-gui 1.0
  3. #
  4. # Copyright (c) 2017 Elias Ojala
  5. #
  6. # Permission to use, copy, modify, and/or distribute this software for any
  7. # purpose with or without fee is hereby granted, provided that the above
  8. # copyright notice and this permission notice appear in all copies.
  9. #
  10. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. #
  18. # https://github.com/theel0ja/shashlik-gui
  19. FILE=`zenity --file-selection --title="Yüklemek istediğiniz bir .apk dosyası seçin"`
  20. case $? in
  21. 0)
  22. case "${FILE##*.}" in
  23. apk)
  24. zenity --question --text="$FILE dosyasını yüklemek istiyor musunuz?"
  25. case $? in
  26. 0)
  27. /opt/shashlik/bin/shashlik-install $FILE
  28. ;;
  29. 1)
  30. zenity --warning --text="Uygulama yüklenemedi.";;
  31. -1)
  32. zenity --error --text="Beklenmeyen bir hata oluştu.";;
  33. esac
  34. ;;
  35. *)
  36. zenity --error --text="Geçersiz dosya türü.";;
  37. esac
  38. ;;
  39. 1)
  40. zenity --error --text="Dosya seçilmedi.";;
  41. -1)
  42. zenity --error --text="Beklenmeyen bir hata oluştu.";;
  43. esac