[asterisk-users] System() command refuses to execute bash script

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Mar 2 09:28:31 CST 2015


Hi,

Some notes,

Don't run Asterisk as root.

But also:

On Mon, Mar 02, 2015 at 04:44:48PM +0200, Stefan Viljoen wrote:
> Hi all
> 
> I got this solved.
> 
> Turns out the script WAS executing, but I forgot that apparently you need to
> follow "cron rules" in any BASH scripts executed via System() from an
> Asterisk dialplan.
> 
> E. g. all paths must be fully and absolutely specified, there are no
> relative path references available.
> 
> So I changed the the file wireless.sh which was:
> 
> #!/bin/bash
> touch wireless-executed
> 
> to
> 
> #!/bin/bash
> touch /root/wireless-executed

A variant on:

  cd `dirname $0`

can help in such cases.

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com



More information about the asterisk-users mailing list