GetTorProcess 845 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. # shellcheck shell=bash
  3. # ``````````````````````````````````````````````````````````````````````````````
  4. # Function name: GetTorProcess()
  5. #
  6. # Description:
  7. # Get info about tor process.
  8. #
  9. # Usage:
  10. # GetTorProcess
  11. #
  12. # Examples:
  13. # GetTorProcess
  14. #
  15. function GetTorProcess() {
  16. # shellcheck disable=SC2034
  17. local _FUNCTION_ID="GetTorProcess"
  18. local _STATE=0
  19. # shellcheck disable=SC2034,SC2154
  20. _tor_proc_id=$(echo "$_tproc" | awk '{print $1}')
  21. # shellcheck disable=SC2034
  22. _tor_proc_config=$(echo "$_tproc" | awk '{print $7}')
  23. # shellcheck disable=SC2034
  24. _tor_proc_socks=$(echo "$_tproc" | awk '{print $13}')
  25. # shellcheck disable=SC2034
  26. _tor_proc_control=$(echo "$_tproc" | awk '{print $15}')
  27. # shellcheck disable=SC2034
  28. _tor_prod_data_dir=$(echo "$_tproc" | awk '{print $19}')
  29. return $_STATE
  30. }