v2.0.0.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env bash
  2. git config core.ignorecase false
  3. chmod 777 /app/data/tmp -R
  4. service crond restart
  5. hostname=`hostname`
  6. domain=`php /app/bin/tools.php getDomain`
  7. port=`php /app/bin/tools.php getPort`
  8. #初始化统计数据
  9. curl -s http://${domain}:${port}/v2/tools/init?key=statistics
  10. #初始化报表
  11. curl -s http://${domain}:${port}/v2/tools/init?key=report
  12. #初始化票据
  13. curl -s http://${domain}:${port}/v2/tools/init?key=bill
  14. #初始化公司账户成功
  15. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=reportAccount
  16. #初始化销售单票据金额
  17. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=billAmount
  18. #初始化管理员权限
  19. curl -s http://${domain}:${port}/v2/tools/init?key=rule
  20. #初始化管理员权限
  21. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=2019-02-14
  22. #财务报表数据
  23. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=statement
  24. #仓库报表数据
  25. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=inventory
  26. #加工进仓报表数据
  27. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=processIn
  28. #加工进度出仓报表数据
  29. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=processOut
  30. #开票收票报表数据
  31. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=ticket
  32. #初始化管理员权限
  33. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=init_admin_rule
  34. #更新产品库模板
  35. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=product_template_update
  36. #订单事务更新
  37. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=order_affair_update
  38. #安装wkhtmltopdf
  39. if [ ! -x "$(command -v wkhtmltopdf)" ]; then
  40. yum install -y urw-fonts libXext openssl-devel libXrender
  41. wget -O /usr/share/fonts/simsun.ttc http://mi.lacecdn.com/docker/simsun.ttc
  42. wget -O /usr/share/fonts/simfang.ttf http://mi.lacecdn.com/docker/simfang.ttf
  43. wget -O /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz http://mi.lacecdn.com/docker/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  44. cd /tmp
  45. tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  46. rm -rf /usr/local/wkhtmltox
  47. mv wkhtmltox /usr/local/
  48. chmod +x /usr/local/wkhtmltox/bin/wkhtmltopdf
  49. chmod +x /usr/local/wkhtmltox/bin/wkhtmltoimage
  50. ln -sf /usr/local/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
  51. ln -sf /usr/local/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  52. rm -rf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  53. fi
  54. sed -i 's/^max_allowed_packet = 1M/max_allowed_packet = 16M/' /etc/my.cnf
  55. if [ ! -f /etc/init.d/redis ];then
  56. wget -O /etc/init.d/redis http://mi.lacecdn.com/docker/init.d.redis
  57. chmod +x /etc/init.d/redis
  58. service redis start
  59. chkconfig redis on
  60. fi