• Ludovic S. Clain

    (@ludovicsclain)


    Hi Dip ??

    I tried emailing you but I don’t know if you received it, I really would have liked your help customizing the function to run a bash script with parameters.

    So far I have something like this (I’m not familiar with the code, please don’t laugh ?? ):

    add_filter('wcra_wcra_test_callback', 'wcra_wcra_test_callback_handler');
    
    function wcra_wcra_test_callback_handler($param)
    {
    	//$param = All GET/POST values will be received from endpoint
    	//do your stuff here
      $param_1 = $param['P_ONE'];
      $param_2 = $param['P_TWO'];
      $param_3 = $param['P_THREE'];
      $param_4 = $param['P_FOUR'];
      echo shell_exec('/bin/bash /path/to/mybashscript.sh $param_1 $param_2 $param_3 $param_4');
    
    }

    Thank you for your help ??
    Ludovic

  • The topic ‘Need help to run a bash script’ is closed to new replies.