diff options
Diffstat (limited to 'localshowkannelstatus')
-rwxr-xr-x | localshowkannelstatus | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/localshowkannelstatus b/localshowkannelstatus new file mode 100755 index 0000000..544e4de --- /dev/null +++ b/localshowkannelstatus @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +open(LOGFILE,"/etc/kannel/kannel.conf"); +while (<LOGFILE>) { + /^smsc-id\h+=\h+(\S+)/ && do { + $smsc=$1 + }; + /^my-number\h+=\h+\+?(45)?(\S+)/ && do { + $i++; + $a .= "$2 ($smsc)\n" + } +}; + +open(PS,"ps ax|"); +do { + /perl\s.*markdown2sms.*sms\s*\+?(45)?(\d+)\s+\b(\S+)/ && do { + $j++; $b .= "$2: $3\n"; + }; +} while (<PS>); + +print "$i phones:\n$a"; +print "\n$j series:\n$b" if ($j); |