I'm tryng to execute de folowing comand : 'perl -w /usr/bin/human.pl' on a filter, but it doesn't work. I already tested the same command on the terminal window and it worked fine. The script was made to send an SMS message using a SMS serviçe in Brazil. The ZM version is 1.22.3 from Peter Howard. Below is the script that I saved in /usr/bin (human.pl):
#!/usr/bin/perl
require "config.cgi";
use CGI;
$cgi = new CGI;
##################################
&enviasms;
#####Código 1######
sub enviasms{
$dispatch = "send";
$account = "nome_da_conta";
$code = "codigo_da_conta";
$msg = "$msgx";
$from = "Nome da Empresa";
$to = "$cel";
$id = time();
$user = $id - 1;
$schedule = "";
$callbackOption = "";
$palavra = "000 - Message sent";
use LWP::Simple;
$resultado = get(" http://system.human.com.br:8080/Gateway ... backOption ");
if(!$resultado){
print "Não foi posivel uma comunicação com o servidor!";
} elsif($resultado =~/$palavra/i) {
print "SMS enviado com sucesso!";
}else{
print "SMS não foi enviado!";
}
}
I checked the syslog file and it says the perl script couldn't be found. Is it a permission problem?
Run perl script on filter
-
- Posts: 33
- Joined: Thu Oct 26, 2006 6:00 pm
Permissions
I did a chmod 777 on the file, so it has all the possible permissions.
2230420 -rwxrwxrwx 1 root root 924 2007-08-22 19:41 human.pl
But the syslog file is sayng:
Aug 31 09:15:40 kokoon zmfilter[9934]: ERR [Auto execute script 'perl' not found, skipping filter 'Alarme_Noite']
2230420 -rwxrwxrwx 1 root root 924 2007-08-22 19:41 human.pl
But the syslog file is sayng:
Aug 31 09:15:40 kokoon zmfilter[9934]: ERR [Auto execute script 'perl' not found, skipping filter 'Alarme_Noite']
-
- Posts: 33
- Joined: Thu Oct 26, 2006 6:00 pm
Script folder
Cordel,
I forgot to tell you that the human.pl script file is in the folder: /usr/bin
thank you,
Daniel
I forgot to tell you that the human.pl script file is in the folder: /usr/bin
thank you,
Daniel