Simple Bash script for proxychains












0















I want to run the following command:



#! /bin/bash 
proxychains myApp —arg


If I put this into a Bash script it would start proxychains and myApp, but they are not linked to eachother! Proxychains then times out and traffic from myApp isn’t passed through the proxy.



The syntax is: proxychains program [args]



Edit: Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.










share|improve this question




















  • 1





    Perhaps you should add what you put (not the default examples) in proxychains.conf as well as what proxy you're then using as proxychains' backend ? Else how can anybody guess? Also statically linked apps are unaffected by proxychains ( proxychains printenv|grep LD_PRELOAD => LD_PRELOAD=libproxychains.so.3 )

    – A.B
    Jan 16 '18 at 21:46













  • The proxychains.conf is fine. If I put „proxychains myApp —arg“ in the console everything works as expected. It’s just the bash script that isn’t working because it isn’t linking proxychains and myApp. It’s like the bash script is opening proxychains and myApp as two separate programs.

    – Olaf
    Jan 16 '18 at 22:02













  • So when you run your bash script on the console (still interactively) it doesn't work?

    – A.B
    Jan 16 '18 at 22:34











  • Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.

    – Olaf
    Jan 17 '18 at 7:57













  • Then sorry I have no clue (except that I doubt it's what you say it is)

    – A.B
    Jan 17 '18 at 17:39
















0















I want to run the following command:



#! /bin/bash 
proxychains myApp —arg


If I put this into a Bash script it would start proxychains and myApp, but they are not linked to eachother! Proxychains then times out and traffic from myApp isn’t passed through the proxy.



The syntax is: proxychains program [args]



Edit: Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.










share|improve this question




















  • 1





    Perhaps you should add what you put (not the default examples) in proxychains.conf as well as what proxy you're then using as proxychains' backend ? Else how can anybody guess? Also statically linked apps are unaffected by proxychains ( proxychains printenv|grep LD_PRELOAD => LD_PRELOAD=libproxychains.so.3 )

    – A.B
    Jan 16 '18 at 21:46













  • The proxychains.conf is fine. If I put „proxychains myApp —arg“ in the console everything works as expected. It’s just the bash script that isn’t working because it isn’t linking proxychains and myApp. It’s like the bash script is opening proxychains and myApp as two separate programs.

    – Olaf
    Jan 16 '18 at 22:02













  • So when you run your bash script on the console (still interactively) it doesn't work?

    – A.B
    Jan 16 '18 at 22:34











  • Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.

    – Olaf
    Jan 17 '18 at 7:57













  • Then sorry I have no clue (except that I doubt it's what you say it is)

    – A.B
    Jan 17 '18 at 17:39














0












0








0








I want to run the following command:



#! /bin/bash 
proxychains myApp —arg


If I put this into a Bash script it would start proxychains and myApp, but they are not linked to eachother! Proxychains then times out and traffic from myApp isn’t passed through the proxy.



The syntax is: proxychains program [args]



Edit: Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.










share|improve this question
















I want to run the following command:



#! /bin/bash 
proxychains myApp —arg


If I put this into a Bash script it would start proxychains and myApp, but they are not linked to eachother! Proxychains then times out and traffic from myApp isn’t passed through the proxy.



The syntax is: proxychains program [args]



Edit: Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.







linux bash shell-script






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









Rui F Ribeiro

41.5k1483140




41.5k1483140










asked Jan 16 '18 at 21:00









OlafOlaf

12




12








  • 1





    Perhaps you should add what you put (not the default examples) in proxychains.conf as well as what proxy you're then using as proxychains' backend ? Else how can anybody guess? Also statically linked apps are unaffected by proxychains ( proxychains printenv|grep LD_PRELOAD => LD_PRELOAD=libproxychains.so.3 )

    – A.B
    Jan 16 '18 at 21:46













  • The proxychains.conf is fine. If I put „proxychains myApp —arg“ in the console everything works as expected. It’s just the bash script that isn’t working because it isn’t linking proxychains and myApp. It’s like the bash script is opening proxychains and myApp as two separate programs.

    – Olaf
    Jan 16 '18 at 22:02













  • So when you run your bash script on the console (still interactively) it doesn't work?

    – A.B
    Jan 16 '18 at 22:34











  • Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.

    – Olaf
    Jan 17 '18 at 7:57













  • Then sorry I have no clue (except that I doubt it's what you say it is)

    – A.B
    Jan 17 '18 at 17:39














  • 1





    Perhaps you should add what you put (not the default examples) in proxychains.conf as well as what proxy you're then using as proxychains' backend ? Else how can anybody guess? Also statically linked apps are unaffected by proxychains ( proxychains printenv|grep LD_PRELOAD => LD_PRELOAD=libproxychains.so.3 )

    – A.B
    Jan 16 '18 at 21:46













  • The proxychains.conf is fine. If I put „proxychains myApp —arg“ in the console everything works as expected. It’s just the bash script that isn’t working because it isn’t linking proxychains and myApp. It’s like the bash script is opening proxychains and myApp as two separate programs.

    – Olaf
    Jan 16 '18 at 22:02













  • So when you run your bash script on the console (still interactively) it doesn't work?

    – A.B
    Jan 16 '18 at 22:34











  • Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.

    – Olaf
    Jan 17 '18 at 7:57













  • Then sorry I have no clue (except that I doubt it's what you say it is)

    – A.B
    Jan 17 '18 at 17:39








1




1





Perhaps you should add what you put (not the default examples) in proxychains.conf as well as what proxy you're then using as proxychains' backend ? Else how can anybody guess? Also statically linked apps are unaffected by proxychains ( proxychains printenv|grep LD_PRELOAD => LD_PRELOAD=libproxychains.so.3 )

– A.B
Jan 16 '18 at 21:46







Perhaps you should add what you put (not the default examples) in proxychains.conf as well as what proxy you're then using as proxychains' backend ? Else how can anybody guess? Also statically linked apps are unaffected by proxychains ( proxychains printenv|grep LD_PRELOAD => LD_PRELOAD=libproxychains.so.3 )

– A.B
Jan 16 '18 at 21:46















The proxychains.conf is fine. If I put „proxychains myApp —arg“ in the console everything works as expected. It’s just the bash script that isn’t working because it isn’t linking proxychains and myApp. It’s like the bash script is opening proxychains and myApp as two separate programs.

– Olaf
Jan 16 '18 at 22:02







The proxychains.conf is fine. If I put „proxychains myApp —arg“ in the console everything works as expected. It’s just the bash script that isn’t working because it isn’t linking proxychains and myApp. It’s like the bash script is opening proxychains and myApp as two separate programs.

– Olaf
Jan 16 '18 at 22:02















So when you run your bash script on the console (still interactively) it doesn't work?

– A.B
Jan 16 '18 at 22:34





So when you run your bash script on the console (still interactively) it doesn't work?

– A.B
Jan 16 '18 at 22:34













Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.

– Olaf
Jan 17 '18 at 7:57







Just to clarify this: If I just type the command in an active console, it works. Same command in a bash script doesn’t work.

– Olaf
Jan 17 '18 at 7:57















Then sorry I have no clue (except that I doubt it's what you say it is)

– A.B
Jan 17 '18 at 17:39





Then sorry I have no clue (except that I doubt it's what you say it is)

– A.B
Jan 17 '18 at 17:39










2 Answers
2






active

oldest

votes


















0














Use the absolute path for both programs.






share|improve this answer
























  • Doesn’t work either

    – Olaf
    Jan 17 '18 at 16:12



















0














When I was running into the error I ran the script with sudo, because there were other parts in the script that depended on it.
Strangely it works fine if I run the proxychains part without sudo... Guess I somehow messed up the user permissions.






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f417619%2fsimple-bash-script-for-proxychains%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Use the absolute path for both programs.






    share|improve this answer
























    • Doesn’t work either

      – Olaf
      Jan 17 '18 at 16:12
















    0














    Use the absolute path for both programs.






    share|improve this answer
























    • Doesn’t work either

      – Olaf
      Jan 17 '18 at 16:12














    0












    0








    0







    Use the absolute path for both programs.






    share|improve this answer













    Use the absolute path for both programs.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 17 '18 at 1:11









    Hauke LagingHauke Laging

    57.3k1287135




    57.3k1287135













    • Doesn’t work either

      – Olaf
      Jan 17 '18 at 16:12



















    • Doesn’t work either

      – Olaf
      Jan 17 '18 at 16:12

















    Doesn’t work either

    – Olaf
    Jan 17 '18 at 16:12





    Doesn’t work either

    – Olaf
    Jan 17 '18 at 16:12













    0














    When I was running into the error I ran the script with sudo, because there were other parts in the script that depended on it.
    Strangely it works fine if I run the proxychains part without sudo... Guess I somehow messed up the user permissions.






    share|improve this answer






























      0














      When I was running into the error I ran the script with sudo, because there were other parts in the script that depended on it.
      Strangely it works fine if I run the proxychains part without sudo... Guess I somehow messed up the user permissions.






      share|improve this answer




























        0












        0








        0







        When I was running into the error I ran the script with sudo, because there were other parts in the script that depended on it.
        Strangely it works fine if I run the proxychains part without sudo... Guess I somehow messed up the user permissions.






        share|improve this answer















        When I was running into the error I ran the script with sudo, because there were other parts in the script that depended on it.
        Strangely it works fine if I run the proxychains part without sudo... Guess I somehow messed up the user permissions.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 18 '18 at 9:07









        JAD

        103115




        103115










        answered Jan 18 '18 at 8:04









        OlafOlaf

        12




        12






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f417619%2fsimple-bash-script-for-proxychains%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt