dtcd.sh 663 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. ulimit -c unlimited
  3. session_token=`pwd | awk -F'/' '{print $5}'`
  4. session_port=`pwd | awk -F'/' '{print $6}'`
  5. DTC_BIN="dtcd_${session_token}_${session_port}"
  6. rm -f "$DTC_BIN"
  7. ln -s dtcd "$DTC_BIN"
  8. DisableDataSource=`cat ../conf/cache.conf | grep DisableDataSource | awk -F"=" '{print $2}'`
  9. db_machine_num=`cat ../conf/table.conf | grep MachineNum | awk -F"=" '{print $2}'`
  10. if [ "$1" = "stop" ] ; then
  11. killall $DTC_BIN
  12. elif [ "$1" = "restart" ]; then
  13. killall $DTC_BIN
  14. sleep 3
  15. ./$DTC_BIN >> /dev/null 2>&1
  16. elif [ "$1" = "start" ]; then
  17. ./$DTC_BIN >> /dev/null 2>&1
  18. sleep 1
  19. else
  20. echo "usage: $0 stop | start |restart"
  21. fi