summaryrefslogtreecommitdiff
path: root/localshowkannelstatus
blob: 544e4de77831240a78ff45bb10487cbd19cd4ed7 (plain)
  1. #!/usr/bin/perl
  2. open(LOGFILE,"/etc/kannel/kannel.conf");
  3. while (<LOGFILE>) {
  4. /^smsc-id\h+=\h+(\S+)/ && do {
  5. $smsc=$1
  6. };
  7. /^my-number\h+=\h+\+?(45)?(\S+)/ && do {
  8. $i++;
  9. $a .= "$2 ($smsc)\n"
  10. }
  11. };
  12. open(PS,"ps ax|");
  13. do {
  14. /perl\s.*markdown2sms.*sms\s*\+?(45)?(\d+)\s+\b(\S+)/ && do {
  15. $j++; $b .= "$2: $3\n";
  16. };
  17. } while (<PS>);
  18. print "$i phones:\n$a";
  19. print "\n$j series:\n$b" if ($j);