pacman_install 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # arg 1: the new package version
  2. #pre_install() {
  3. #}
  4. # arg 1: the new package version
  5. post_install() {
  6. # do something here
  7. cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service
  8. cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/
  9. cp /usr/share/rustdesk/files/rustdesk-link.desktop /usr/share/applications/
  10. systemctl daemon-reload
  11. systemctl enable rustdesk
  12. systemctl start rustdesk
  13. update-desktop-database
  14. }
  15. # arg 1: the new package version
  16. # arg 2: the old package version
  17. pre_upgrade() {
  18. systemctl stop rustdesk || true
  19. }
  20. # arg 1: the new package version
  21. # arg 2: the old package version
  22. post_upgrade() {
  23. cp /usr/share/rustdesk/files/rustdesk.service /etc/systemd/system/rustdesk.service
  24. cp /usr/share/rustdesk/files/rustdesk.desktop /usr/share/applications/
  25. cp /usr/share/rustdesk/files/rustdesk-link.desktop /usr/share/applications/
  26. systemctl daemon-reload
  27. systemctl enable rustdesk
  28. systemctl start rustdesk
  29. update-desktop-database
  30. }
  31. # arg 1: the old package version
  32. pre_remove() {
  33. systemctl stop rustdesk || true
  34. systemctl disable rustdesk || true
  35. rm /etc/systemd/system/rustdesk.service || true
  36. }
  37. # arg 1: the old package version
  38. post_remove() {
  39. rm /usr/share/applications/rustdesk.desktop || true
  40. rm /usr/share/applications/rustdesk-link.desktop || true
  41. update-desktop-database
  42. }