Advertisement
Guest User

Untitled

a guest
Jan 12th, 2015
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. # start the B3 instance and sleep a bit: give it time to crash (if that's the case).
  2. # recompute also the PID file path because $(b3_pid_path) may output an empty string
  3. # if the B3 was not running (and thus no PID file could be found in previous call)
  4. local SCREEN="${COMMON_PREFIX}${B3}"
  5. local PROCESS="$(readlink -f "${B3_RUN}")"
  6. local PID_FILE="$(readlink -f "${PID_PATH}/${COMMON_PREFIX}${B3}${PID_EXT}")"
  7.  
  8. if [ ${AUTO_RESTART} -eq 1 ]; then
  9. screen -DmS "${SCREEN}" python "${PROCESS}" --restart --config "${CONFIG_FILE}" &
  10. else
  11. screen -DmS "${SCREEN}" python "${PROCESS}" --config "${CONFIG_FILE}" &
  12. fi
  13.  
  14. echo "${!}" > "${PID_FILE}"
  15.  
  16. if [ ${AUTO_RESTART} -eq 1 ]; then
  17. sleep 4
  18. else
  19. sleep 1
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement