#!/usr/bin/perl



use FTN::Packet qw(&write_ftn_packet);
use FTN::Log qw(&logging);


#my $spool_dir = "/var/spool/ftn";
my $spool_dir = "/data/ftp/pub/CODE/FIDO/rssbot";
my $OutDir = "$spool_dir/inbound";
my $log_file = "$spool_dir/packet.log";

my $ftnsubj="Test subj test aamigo adios";
my $ftnbody="Hi amigo, how are you wdwdwddw wdwdwqdw dwqdqwd wdqw wqd qwdwdwqdwq d qdwwqd wqddfgdgsadgdsagdsagsadgdsagsdagdgdsgdsagdgadsagdsagsgsa? \n 
wdwqdqwdwqdwqdqwdqdq  dqw dwq dwqdqwdwqd dq wqdq dqwdqwdwqdwqd d qwdwqdwqdwqd qwd wqdd wqdqwdq dqwwqsagdsagdsagasgsadgdsagdsagdsagdsa sgdaadgsa\n
 wqdqwdwq ewfqw ff wq f wqfe qw ff wqfew fqewf ew few fwqf ffewqf, wefff qqfeewqef ef wqefqfqf. WBR Ruslan gsadgsg sagdsagsagsa sgagdsgadsgdsa\n";
${messages}[0]{area}="4.PVT";
${messages}[0]{tonode}="2:467/4";
${messages}[0]{Fromnode}="2:467/4";
${messages}[0]{From}="Novyny Ukraini";
${messages}[0]{To}="All";
${messages}[0]{Subj}=$ftnsubj;
${messages}[0]{Body}=$ftnbody;
${messages}[0]{ctrlinfo}="TID: FIDOGATE-5.12-a97f4004";
${packet_info}{origNet}="467";
${packet_info}{PassWord}="TRF5UAUA";                             # a8
${packet_info}{origZone}="2";                              # S   (repeat)
${packet_info}{destZone}="2";                             # S   (repeat)
${packet_info}{origPoint}="444";
${packet_info}{origNode}="4";                          # S   (repeat)
${packet_info}{destNode}="4";                         # S   (repeat)
${packet_info}{destNet}="467";
# Time format: 17 Oct 22 23:19:06
##my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
##$year += 1900;
##my @abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
# $year = substr($year,2);
##my $ttime=$mday." ".$abbr[$mon]." ".$year." ".$hour.":".$min.":".$sec;
#

##${messages}[0]{ftscdate}=$ttime;
##${messages}[0]{DateTime}=$ttime;
${packet_info}{Area}="4.PVT";
${packet_info}{Origin}=" /Robocop v.1 origin/ ";
${packet_info}{TearLine}=" *Danke Shon Germany tearline* ";

write_ftn_packet($OutDir, \%packet_info, \@messages);
