tt-rss-mysql.postinst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. set -e
  3. PACKAGE=tt-rss-mysql
  4. case "$1" in
  5. configure)
  6. # source debconf stuff
  7. if [ -f /usr/share/debconf/confmodule ]; then
  8. . /usr/share/debconf/confmodule
  9. fi
  10. # debconf messages
  11. db_get $PACKAGE/webserver || true
  12. WEBSERVER="$RET";
  13. # webserver configuration
  14. if $WEBSERVER; then
  15. if [ ! -d /etc/apache2/conf.d/ ]; then
  16. install -d -m755 /etc/apache2/conf.d/
  17. fi
  18. if [ ! -e /etc/apache2/conf.d/$PACKAGE.conf ]; then
  19. ln -s /etc/$PACKAGE/apache.conf /etc/apache2/conf.d/$PACKAGE.conf
  20. #sed -e "s#tt-rss/www#$PACKAGE/www#" -i /etc/$PACKAGE/apache.conf
  21. fi
  22. if apache2ctl configtest 2>/dev/null; then
  23. invoke-rc.d apache2 force-reload || true
  24. else
  25. echo "apache need to be reload manualy"
  26. fi
  27. fi
  28. # dbconfig-common
  29. . /usr/share/dbconfig-common/dpkg/postinst.mysql
  30. dbc_first_version="1.3.1"
  31. dbc_generate_include="php:/etc/$PACKAGE/database.php"
  32. dbc_generate_include_owner="root:www-data"
  33. dbc_generate_include_perms="0640"
  34. dbc_go $PACKAGE $@
  35. echo "Install ok on http://localhost/tt-rss/"
  36. ;;
  37. abort-upgrade|abort-remove|abort-deconfigure)
  38. ;;
  39. *)
  40. echo "postinst called with unknown argument \`$1'" >&2
  41. exit 1
  42. ;;
  43. esac
  44. exit 0
  45. #DEBHELPER#