Hi all,
I'm using DirectAdmin version 1.45.0.
I follow instruction here ... http://www.directadmin.com/features.php?id=657 and
I wanted to run my own script via DA API located in /usr/local/directadmin/scripts/myscript/helloworld.sh
Here're permission I have for it...
-rwxr-xr-x 1 diradmin diradmin 41 Mar 9 10:29 /usr/local/directadmin/scripts/myscript/helloworld.sh
---- This is the error output ----
Array ( [error] => 1 [text] => Unable To Execute Your Command [details] => User command execution is not enabled )
Can any one advise how to solve this issue?
Thanks so much.
---- I added "allow_user_exec=1" into is my DA config ----
cat /usr/local/directadmin/conf/directadmin.conf | grep exec
allow_user_exec=1
---- This is my code to test the feature ----
include 'httpsocket.php';
$sock = new HTTPSocket;
$servers = array(
'IP' => array('admin','password')
);
foreach($servers as $server => $credentials) {
$sock->connect($server,2222);
$sock->set_login($credentials[0],$credentials[1]);
$sock->query('/CMD_API_EXEC',
array(
'command' => '/usr/local/directadmin/scripts/myscript/helloworld.sh',
'options' => ""
));
$result = $sock->fetch_parsed_body();
print_r($result);
}
---- This is helloworld.sh ---
#!/bin/sh
echo "The sun is starting to rise..."
I'm using DirectAdmin version 1.45.0.
I follow instruction here ... http://www.directadmin.com/features.php?id=657 and
I wanted to run my own script via DA API located in /usr/local/directadmin/scripts/myscript/helloworld.sh
Here're permission I have for it...
-rwxr-xr-x 1 diradmin diradmin 41 Mar 9 10:29 /usr/local/directadmin/scripts/myscript/helloworld.sh
---- This is the error output ----
Array ( [error] => 1 [text] => Unable To Execute Your Command [details] => User command execution is not enabled )
Can any one advise how to solve this issue?
Thanks so much.
---- I added "allow_user_exec=1" into is my DA config ----
cat /usr/local/directadmin/conf/directadmin.conf | grep exec
allow_user_exec=1
---- This is my code to test the feature ----
include 'httpsocket.php';
$sock = new HTTPSocket;
$servers = array(
'IP' => array('admin','password')
);
foreach($servers as $server => $credentials) {
$sock->connect($server,2222);
$sock->set_login($credentials[0],$credentials[1]);
$sock->query('/CMD_API_EXEC',
array(
'command' => '/usr/local/directadmin/scripts/myscript/helloworld.sh',
'options' => ""
));
$result = $sock->fetch_parsed_body();
print_r($result);
}
---- This is helloworld.sh ---
#!/bin/sh
echo "The sun is starting to rise..."