multitor 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/env bash
  2. ### BEG SCRIPT INFO
  3. #
  4. # Header:
  5. #
  6. # fname : "multitor"
  7. # cdate : "09.01.2018"
  8. # author : "Michał Żurawski <trimstray@gmail.com>"
  9. # tab_size : "2"
  10. # soft_tabs : "yes"
  11. #
  12. # Description:
  13. #
  14. # See README.md file for more information.
  15. #
  16. # The multitor has been completely rewritten on the basis of:
  17. # - Multi-TOR project written by Jan Seidl:
  18. # https://github.com/jseidl/Multi-TOR
  19. # - original source is (Sebastian Wain project):
  20. # http://blog.databigbang.com/distributed-scraping-with-multiple-tor-circuits/
  21. #
  22. # License:
  23. #
  24. # multitor, Copyright (C) 2018 Michał Żurawski
  25. #
  26. # This program is free software: you can redistribute it and/or modify
  27. # it under the terms of the GNU General Public License as published by
  28. # the Free Software Foundation, either version 3 of the License, or
  29. # (at your option) any later version.
  30. #
  31. # This program is distributed in the hope that it will be useful,
  32. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. # GNU General Public License for more details.
  35. #
  36. # You should have received a copy of the GNU General Public License
  37. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  38. #
  39. ### END SCRIPT INFO
  40. # The array that store call parameters.
  41. # shellcheck disable=SC2034
  42. __init_params=()
  43. __script_params=("$@")
  44. # Store the name of the script and directory call.
  45. readonly _init_name="$(basename "$0")"
  46. readonly _init_directory="$(dirname "$(readlink -f "$0")")"
  47. # Set root directory.
  48. readonly _rel="${_init_directory}/.."
  49. # Directory structure.
  50. # shellcheck disable=SC2154
  51. readonly _src="${_rel}/src"
  52. readonly _lib="${_rel}/lib"
  53. readonly _etc="${_rel}/etc"
  54. readonly _tml="${_rel}/templates"
  55. # shellcheck disable=SC1090,SC1091
  56. source "${_src}/settings"
  57. # shellcheck disable=SC1090
  58. source "${_src}/helpers"
  59. # shellcheck disable=SC1090
  60. source "${_src}/__init__"
  61. # We pass arguments to the __main__ function.
  62. # It is required if you want to run on arguments type $1, $2, ...
  63. __main__ "${__script_params[@]}"
  64. _exit_ "0"