Stefan Viljoen
2015-Mar-02 14:27 UTC
[asterisk-users] System() command refuses to execute bash script
Hi All I'm using this extension to try and get Asterisk 1.8.11.0 to run a bash script: exten=>802,n,System(/bin/sh -f /root/wireless.sh) This file is -rwxr-xr-x 1 root root 171 Mar 2 16:23 wireless.sh e.g. root owns the file, and it has execute permissions for all users. Asterisk runs as root as well. Asterisk executes the command without any errors at max verbosity. The file wireless.sh contains: #!/bin/bash touch wireless-executed In my /root folder however, the file wireless-executed is never written - indicating the script does not execute, even though it is owner by the same user asterisk runs as, and is world-executable. How can I use System to run a bash script? Thanks! Regards Stefan
Kevin Larsen
2015-Mar-02 14:32 UTC
[asterisk-users] System() command refuses to execute bash script
asterisk-users-bounces at lists.digium.com wrote on 03/02/2015 08:27:07 AM:> From: "Stefan Viljoen" <viljoens at verishare.co.za> > To: <asterisk-users at lists.digium.com>, > Date: 03/02/2015 08:27 AM > Subject: [asterisk-users] System() command refuses to execute bashscript> How can I use System to run a bash script?Just to rule out some weird permissions issue, try to write the file to some directory that has full read/write permissions to everyone (eg 777). If the file can be written to that directory you probably have a permissions issue still. I run my asterisk under the asterisk user and have it kick of scripts that write to a folder on the system all the time. The folder has full permissions for the Asterisk user. Give it a shot and see what you get. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150302/57432053/attachment.html>