[mythtv] Ticket #9782: commit 8bf5157fd breaks UDP OSD notify & mythmessage
Warpme
warpme at o2.pl
Tue May 17 20:29:27 UTC 2011
On 5/17/11 9:37 PM, MythTV wrote:
> #9782: commit 8bf5157fd breaks UDP OSD notify& mythmessage
> -----------------------------------+----------------------------
> Reporter: warped<warpme@…> | Owner:
> Type: Bug Report - General | Status: new
> Priority: minor | Milestone: unknown
> Component: MythTV - General | Version: Trunk Head
> Severity: medium | Resolution:
> Keywords: | Ticket locked: 0
> -----------------------------------+----------------------------
>
> Comment (by greg):
>
> Do you have any log entries or cut n pastes of the exact commandlines you
> are using I can check out? It works just fine for me here
>
>
> Thanks
>
Greg,
Below is v.simple utility I'm using in my system.
Call it
osd_notify.pl mythadder_remove
code:
#!/usr/bin/perl -w
#
# osd_notify.pl
#
use strict;
use warnings;
use IO::Socket;
use feature 'switch';
######################################################################
######### User Defined Variables #########
######################################################################
my
$notify_ip="192.168.1.1;192.168.1.128;192.168.1.129;192.168.1.130;192.168.1.131;192.168.1.132";
my $debug = 0;
######################################################################
######### End User Defined Variables--Modify nothing below #########
######################################################################
my $action = $ARGV[0];
my $param = $ARGV[1];
sub send_osd_notify_to_all_hosts {
my ($text,$ip_list) = @_;
my @dest_list = ();
@dest_list = split(/;/, $ip_list);
for (@dest_list) {
print (" Notify via OSD at IP=$_ with text: \"$text\"\n") if
($debug);
my $msg = "<mythmessage version=\"1\">
<text>$text</text>
</mythmessage>";
my $mythnotify_fh =
IO::Socket::INET->new(PeerAddr=>$_,Proto=>'udp',PeerPort=>6948);
if ($mythnotify_fh) {
print $mythnotify_fh $msg;
$mythnotify_fh->close;
print ("Notify via OSD Done\n") if ($debug);
}
}
}
given ($action) {
when ($action eq "mythadder_add") {
my $mesage = "KOMUNIKAT SYSTEMOWY\n\nDołączono dysk USB o
nazwie\n\'".$param."\'\nJego zawartość będzie widoczna za około 10-15
sekund...";
&send_osd_notify_to_all_hosts($mesage,$notify_ip);
}
when ($action eq "mythadder_remove") {
my $mesage = "KOMUNIKAT SYSTEMOWY\n\n\nOdłączono dysk USB...";
&send_osd_notify_to_all_hosts($mesage,$notify_ip);
}
when ($action eq "backup_add") {
my $mesage = "KOMUNIKAT SYSTEMOWY\n\n\nDołączono
archiwizacyjny dysk USB\nSystem rozpoczyna archiwizację...";
&send_osd_notify_to_all_hosts($mesage,$notify_ip);
}
when ($action eq "backup_remove") {
my $mesage = "KOMUNIKAT SYSTEMOWY\n\nArchiwizacja
zakończona pomyślnie !\nZajętość dysku: ".$param."\nOdłączam dysk
archiwizacyjny...";
&send_osd_notify_to_all_hosts($mesage,$notify_ip);
}
when ($action eq "general_notify") {
my $mesage = "KOMUNIKAT SYSTEMOWY\n\n".$param;
&send_osd_notify_to_all_hosts($mesage,$notify_ip);
}
}
1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: warpme.vcf
Type: text/x-vcard
Size: 89 bytes
Desc: not available
Url : http://www.mythtv.org/pipermail/mythtv-dev/attachments/20110517/ca696cc2/attachment.vcf
More information about the mythtv-dev
mailing list