1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to manage several bot-scripts/proxies on same server? [ bash scripting ]

Discussion in 'Other Scripting Languages' started by m4rdukk, Oct 25, 2012.

  1. m4rdukk

    m4rdukk Newbie

    Joined:
    Oct 23, 2012
    Messages:
    11
    Likes Received:
    3
    Hello!

    I am currently running a small VPS instance running CENTOS 5. I am willing to run some bots that need to have different IP addresses each.
    Hence, I want to buy a pack of proxies and use them as my IP addresses for each one of by bots.
    However, I want to use that from the same CENTOS 5 VPS.

    Note that my bots are not more than BASH scripts, (nothing fancy), that use several commands that interact with the web in eternal loops.

    Does anyone know of any easy way for me to manage these proxies, given my approach?
    For instance, I want script ./bot1.sh to run using proxy1, ./bot2.sh to run using proxy2, and so on.

    I know how to change my VPS's proxy configuration globally, that easy, but is not desirable, as all the bot scripts run simultaneously and if one of them changed something I would have to worry about locking internet communication for the other bots and bla bla. Note also that some commands I use do not have "proxy configuration" arguments, such as wget or curl, some of the commands I need were implemented in a way that does now allow proxy usage natively.


    Erm. Ok, kinda embarrassing, but it seems you can just export the http_proxy variable inside each file separately without interfering with the global environment or each other's script's environment. I Hope it help others :p

    Like:

    Code:
    export http_proxy="$proxy_ip:$proxy_port"
    
     
    Last edited: Oct 25, 2012