+

Add check_authorized_number boolean option

Benjamin Renard [2012-11-29 15:43:42]
Add check_authorized_number boolean option
Filename
mail2gnokii
diff --git a/mail2gnokii b/mail2gnokii
index 622d05f..2273683 100755
--- a/mail2gnokii
+++ b/mail2gnokii
@@ -22,6 +22,7 @@ use Encode qw/encode decode/;

 # Configuration
 $smsc="+33609001390";
+$check_authorized_number=undef;
 @authorized_number=("0612345678","0033600000000");
 $gnokii_config="/etc/gnokiirc";

@@ -90,7 +91,7 @@ sub in_array {
 }

 # Envoie du SMS
-if ($mob ne '' && in_array(\@authorized_number,$mob)){
+if (not $check_authorized_number or $mob ne '' && in_array(\@authorized_number,$mob)){
 	`echo "$subject" | gnokii --config $gnokii_config --sendsms $mob --smsc $smsc`;
 	if($? != 0){
 		print "Error sending SMS";
ViewGit