--- sms.alert 2003/02/14 14:54:45 1.6 +++ sms.alert 2003/02/21 10:36:01 1.7 @@ -28,7 +28,7 @@ # where 123456 is phone number (with country prefix, but without +) and # name is alias used like: # -# sms.alter -f dobrica +# sms.alert -f dobrica # # in mon.cf @@ -79,13 +79,16 @@ # add rest of text $sms .= join("\n",@MSG) if $opt{x}; +my $suffix = 0; + foreach my $to (@ARGV) { - if (open(SMS, "> $sms_outgoing/mon$$")) { + if (open(SMS, "> $sms_outgoing/mon-$$-$suffix")) { my $phone = $to; $phone = $name2phone{lc($to)} if ($name2phone{lc($to)}); die "$phone is not phone number! " if ($phone !~ m/^\d+$/); print SMS "To: $phone\n$sms"; close SMS; + $suffix++; } else { die "could not open sms file in '$sms_outgoing': $!"; }