v3.0.0.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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/report-forms-data-init?key=receiptsDetailedRename
  10. #初始化数据
  11. curl -s http://${domain}:${port}/v2/tools/init
  12. #初始化机台数据
  13. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=machine
  14. #转移报表密码
  15. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=transfer_report_password
  16. #初始化财务数据
  17. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=statement
  18. #初始化权限
  19. curl -s http://${domain}:${port}/v2/tools/init?key=rule
  20. #初始化机台暂停权限
  21. curl -s http://${domain}:${port}/v2/tools/init?key=machinePause
  22. #初始化机台报表数据
  23. curl -s http://${domain}:${port}/v2/tools/init?key=machine
  24. #开票收票报表数据
  25. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=ticket
  26. #安装wkhtmltopdf
  27. if [ ! -x "$(command -v wkhtmltopdf)" ]; then
  28. yum install -y urw-fonts libXext openssl-devel libXrender
  29. wget -O /usr/share/fonts/simsun.ttc http://mi.lacecdn.com/docker/simsun.ttc
  30. wget -O /usr/share/fonts/simfang.ttf http://mi.lacecdn.com/docker/simfang.ttf
  31. 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
  32. cd /tmp
  33. tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  34. rm -rf /usr/local/wkhtmltox
  35. mv wkhtmltox /usr/local/
  36. chmod +x /usr/local/wkhtmltox/bin/wkhtmltopdf
  37. chmod +x /usr/local/wkhtmltox/bin/wkhtmltoimage
  38. ln -sf /usr/local/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
  39. ln -sf /usr/local/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  40. rm -rf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  41. fi
  42. sed -i 's/^max_allowed_packet = 1M/max_allowed_packet = 16M/' /etc/my.cnf
  43. if [ ! -f /etc/init.d/redis ];then
  44. wget -O /etc/init.d/redis http://mi.lacecdn.com/docker/init.d.redis
  45. chmod +x /etc/init.d/redis
  46. service redis start
  47. chkconfig redis on
  48. fi