v3.0.0.sh 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/init?key=customized
  14. #初始化机台数据
  15. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=machine
  16. #转移报表密码
  17. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=transfer_report_password
  18. #初始化财务数据
  19. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=statement
  20. #初始化权限
  21. curl -s http://${domain}:${port}/v2/tools/init?key=rule
  22. #初始化机台暂停权限
  23. curl -s http://${domain}:${port}/v2/tools/init?key=machinePause
  24. #初始化机台报表数据
  25. curl -s http://${domain}:${port}/v2/tools/init?key=machine
  26. #开票收票报表数据
  27. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=ticket
  28. #初始化票据销售时间
  29. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=billOrderTime
  30. #设置内置事务
  31. curl -s http://${domain}:${port}/v2/tools/init?key=setAffairBuildin
  32. #初始化仓库同步
  33. curl -s http://${domain}:${port}/v2/tools/init?key=initWarehouseSyn
  34. #安装wkhtmltopdf
  35. if [ ! -x "$(command -v wkhtmltopdf)" ]; then
  36. yum install -y urw-fonts libXext openssl-devel libXrender
  37. wget -O /usr/share/fonts/simsun.ttc http://mi.lacecdn.com/docker/simsun.ttc
  38. wget -O /usr/share/fonts/simfang.ttf http://mi.lacecdn.com/docker/simfang.ttf
  39. 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
  40. cd /tmp
  41. tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  42. rm -rf /usr/local/wkhtmltox
  43. mv wkhtmltox /usr/local/
  44. chmod +x /usr/local/wkhtmltox/bin/wkhtmltopdf
  45. chmod +x /usr/local/wkhtmltox/bin/wkhtmltoimage
  46. ln -sf /usr/local/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
  47. ln -sf /usr/local/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  48. rm -rf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  49. fi
  50. sed -i 's/^max_allowed_packet = 1M/max_allowed_packet = 16M/' /etc/my.cnf
  51. if [ ! -f /etc/init.d/redis ];then
  52. wget -O /etc/init.d/redis http://mi.lacecdn.com/docker/init.d.redis
  53. chmod +x /etc/init.d/redis
  54. service redis start
  55. chkconfig redis on
  56. fi
  57. if [ -z `php -m | grep imagick` ];then
  58. echo | pecl install imagick
  59. fi