From 9aae9a8398d43d6eb545c44fc6d668bab4c44e6f Mon Sep 17 00:00:00 2001 From: dm5wk Date: Sun, 7 Jan 2024 20:31:12 +0100 Subject: [PATCH] clarifying instructions, deactivating debug output --- README.md | 4 ++-- dapnet2ntfy.pl | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5f86b7e..415c4ea 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Similar to other [gateways](https://hampager.de/dokuwiki/doku.php#gateways_apps) ### DAPNET account -A normal account at [hampager.de](https://support.hampager.de/open.php) (select 'Help Topic -> New DAPNET Account with or without RIC'). +A normal account at [hampager.de](https://support.hampager.de/open.php) (select 'Help Topic -> New DAPNET Account with RIC'). A transmitter registered at [hampager.de](https://support.hampager.de/open.php) (select 'Help Topic -> New DAPNET Transmitter'). @@ -35,7 +35,7 @@ apt install perl-base libio-socket-timeout-perl libhttp-message-perl libwww-perl ## Installation -Instructions for installing the script to $HOME/bin/ +Instructions for installing the script to $HOME/bin/ and activating a systemd user service for running the script ```console mkdir -p $HOME/.config/systemd/user/ cp dapnet2ntfy.service $HOME/.config/systemd/user/ diff --git a/dapnet2ntfy.pl b/dapnet2ntfy.pl index 85a2bfb..616d6de 100755 --- a/dapnet2ntfy.pl +++ b/dapnet2ntfy.pl @@ -8,7 +8,7 @@ use warnings; # configuration -my $version = '0.5.0'; +my $version = '0.5.1'; my $dapnet_username = ''; my $dapnet_password = ''; my $dapnet_server = 'dapnet.afu.rwth-aachen.de'; @@ -17,13 +17,14 @@ my $dapnet_port = '43434', my $ntfy_username = ''; my $ntfy_password = ''; my $ntfy_url = 'https://server/topic'; -my $debug = 1; +my $debug = 0; my $dapnet_timeout_read_seconds = 125; my $dapnet_timeout_write_seconds = 5; my %rics = ( # on pager - '630224' => 'PM', + # add you own RIC in next line + '' => 'PM', '1041' => 'MOWAS', '1063' => 'METAR', '1064' => 'WX-Lokal', @@ -124,7 +125,6 @@ while ($run) { $reconnect = 1; next; } - #$socket->recv($data,1024); chomp $data; debug_print "received: $data.\n" ; if ($data =~ /^2:(.*)$/) { @@ -192,6 +192,5 @@ while ($run) { #} sleep(1); } - #$socket->close(); $socket->shutdown(SHUT_RDWR); }