[Dxspider-support] BadIPs on PC92

Jan cluster at pa4jj.nl
Thu Apr 10 13:28:04 BST 2025


Most recent update_ip.pl  is ver. 1.10
https://github.com/EA3CV/dxspider_info/blob/main/set/update_ip.pl

73
Jan PA4JJ

Op 10-4-2025 om 14:14 schreef Dave Pascoe via Dxspider-support:
> As an aside, here is a version of update_ip.pl <http://update_ip.pl> 
> that handles those of us who run dual-stack (IPv4/IPv6) nodes. At 
> least the v0.8 version of the script handled IPv6 incorrectly. Hope 
> this helps. I had been downloading the script nightly by not running 
> it since I didn't think that was needed due to running a "normal" 
> setup - i.e., not behind NAT and nothing unusual. Just normal public 
> IP addresses.
>
> 73,
> Dave KM3T
>
> #!/usr/bin/perl
> #
> # Updating the $main::localhost_alias_ipv4 and @main::localhost_names var
> #
> # Copy to /spider/local_cmd/update_ip.pl <http://update_ip.pl>
> #
> # Configure crontab:
> # 00,10,20,30,40,50 * * * * run_cmd("update_ip")
> #
> # Notes:
> #
> # Need: apt install libpath-tiny-perl or
> # Module: cpanm install Path::Tiny
> #
> # Kin EA3CV ea3cv at cronux.net
> #
> # 20250215 v0.8
> #
>
> use 5.10.1;
> use Path::Tiny qw(path);
> use strict;
> use warnings;
>
> # Force curl to use IPv4
> my $ip = `curl -4 -s ifconfig.me <http://ifconfig.me>`;
> my $ips = `hostname -I`;          # -i for Docker, -I for the rest
> chomp($ip);  # Remove newline from the public IP
>
> my $var1 = 'set/var $main::localhost_alias_ipv4 =';
> $ip = "'$ip'";
> my $find1 = 'localhost_alias_ipv4';
> startup($var1, $ip, $find1);
>
> my @out;
>
> my $msg1 = $var1 . $ip;
>
> my $var2 = 'set/var @main::localhost_names qw( 127.0.0.1 ::1';
> # Remove trailing spaces and newline from $ips before concatenating
> $ips =~ s/\s+$//;
> $ips = " $ips)";    # Ensure the closing parenthesis is on the same line
> my $find2 = 'localhost_names';
> startup($var2, $ips, $find2);
>
> my $msg2 = $var2 . $ips;
> cmd_import($msg1, $msg2);
>
> # Subroutine to import the file and write to the import directory
> sub cmd_import {
>     my $msg1 = shift;
>     my $msg2 = shift;
>
>     my $dir = "/spider/cmd_import";
>     # Create the directory if it doesn't exist
>     if ( !-d $dir ) {
>         system('mkdir', $dir);
>     }
>
>     my $file = $dir . "/" . 'update_ip';
>
>     open (FH, '>', $file) or die "Could not open file $file: $!";
>     say FH $msg1;
>     say FH $msg2;
>     close (FH);
>
>     # Append messages to output array
>     push @out, " Updated Public and Local IPs.";
>     push @out, " ";
> }
>
> # Subroutine for startup configuration changes
> sub startup {
>     my $var = shift;
>     my $arg = shift;
>     my $find = shift;
>
>     my $filename = '/spider/scripts/startup';
>     my @content = path($filename)->lines_utf8;
>
>     my $e = 0;
>     # Iterate over each line and update if match is found
>     foreach my $row (@content) {
>         if ($row =~ m/$find/) {
>             $row =~ s/.*$find.*/$var $arg/g;
>             path($filename)->spew_utf8(@content);  # Save changes to 
> the file
>             $e = 1;
>         }
>     }
>
>     # If the key was not found, append the new configuration at the 
> end of the file
>     if ($e == 0) {
>         my $data = <<EOF;
> #
> $var $arg
> EOF
>         path($filename)->append_utf8($data);
>     }
> }
>
> # Return the result
> return (1, @out);
>
>
> On Thu, Apr 10, 2025 at 7:07 AM Kin via Dxspider-support 
> <dxspider-support at tobit.co.uk> wrote:
>
>     Hi Ken,
>
>     The main page is here:
>     https://github.com/EA3CV/dxspider_info/tree/main
>
>     The specific script is this one:
>     https://github.com/EA3CV/dxspider_info/blob/main/set/update_ip.pl
>
>     I recommend checking this Wikipedia entry, in case it might be
>     useful to you:
>
>     https://wiki.dxcluster.org/wiki/Setting_up_the_EA3CV_contributions_repository
>
>     73 de Kin EA3CV
>
>     *De:*Ken Sharman <kenny at g7vja.co.uk>
>     *Enviado el:* jueves, 10 de abril de 2025 12:18
>     *Para:* The DXSpider Support list <dxspider-support at tobit.co.uk>
>     *CC:* Kin <ea3cv at cronux.net>
>     *Asunto:* Re: [Dxspider-support] BadIPs on PC92
>
>     Hi Kin
>
>     Can you post the link again, so i can get v 1.10 update_ip
>
>     On new pc, lost most links and contacts.
>
>     Ken G7VJA
>
>     GB7HTL
>
>     On 10 Apr 2025 11:00, Kin via Dxspider-support
>     <dxspider-support at tobit.co.uk> wrote:
>
>         Gregor, If you use set/update_ip, I just fixed the problem.
>         It's in v1.10.
>
>         Regards,
>
>         Kin EA3CV
>
>         *De:*Dxspider-support <dxspider-support-bounces at tobit.co.uk>
>         *En nombre de *Kin via Dxspider-support
>         *Enviado el:* jueves, 10 de abril de 2025 10:44
>         *Para:* The DXSpider Support list <dxspider-support at tobit.co.uk>
>         *CC:* ea3cv at cronux.net
>         *Asunto:* Re: [Dxspider-support] BadIPs on PC92
>
>         Gregor,
>
>         Your startup is missing an IP address.
>
>         If you're using my latest version of the script, that's
>         normal. If not, you should include the missing IP address.
>
>         I noticed there was an error updating the startup. It should
>         be fixed this afternoon.
>
>         But this doesn't affect anything because the variables being
>         used contain the correct value.
>
>         When I get home, I'll check what you're sending again.
>
>         Kin EA3CV
>
>         Enviado desde Outlook para Android <https://aka.ms/AAb9ysg>
>
>         ------------------------------------------------------------------------
>
>         *De:* Dxspider-support <dxspider-support-bounces at tobit.co.uk>
>         en nombre de Gregor Surmann via Dxspider-support
>         <dxspider-support at tobit.co.uk>
>         *Enviado:* miércoles, abril 9, 2025 11:02:45 p. m.
>         *Para:* The DXSpider Support list <dxspider-support at tobit.co.uk>
>         *CC:* Gregor Surmann <gs at funil.de>
>         *Asunto:* Re: [Dxspider-support] BadIPs on PC92
>
>
>         Hello!
>
>         sh/var $main::localhost_alias_ipv4
>         $main::localhost_alias_ipv4 = 82.149.227.228
>
>         sh/var @main::localhost_names
>         @main::localhost_names = '127.0.0.1','::1','82.149.227.228'
>
>         sh/ver
>         DXSpider v1.57 (build 614 git: mojo/2c1717f8[r]) using perl
>         v5.28.1 on Linux
>
>         $ grep -e localhost startup
>         set/var $main::localhost_alias_ipv4 82.149.227.228
>         set/var @main::localhost_names qw(127.0.0.1 ::1)
>
>         So, what do you see from DO5SSB-2?
>
>         73 de Gregor, DO5SSB
>
>
>
>
>         On 09.04.25 20:32, Kin via Dxspider-support wrote:
>         > The list is updated by removing PC92Cs that are forwarded
>         with LAN IPs.
>         >
>         > 7N4TWL-7
>         > 9A0DXC
>         > 9M2PJU-2 > [...]
>
>         --
>         | Gregor 'SinusPL' Surmann | gs at funil.de | Will work for
>         bandwidth |
>         |--------------------------------------------------------------------------|
>         | The UNIX Guru`s view of Sex: | www.sinuspl.net
>         <http://www.sinuspl.net> |
>         | unzip; strip; touch; finger; mount; fsck; more; yes; umount;
>         sleep |
>
>
>         _______________________________________________
>         Dxspider-support mailing list
>         Dxspider-support at tobit.co.uk
>         https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>
>     _______________________________________________
>     Dxspider-support mailing list
>     Dxspider-support at tobit.co.uk
>     https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>
>
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support

-- 
____________________________________________________
my dxspider clusters running on a raspberry pi:
pa4jj-2 77.174.195.163 port 7300
pa4jj-3 77.174.195.163 port 7388
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20250410/4f7790b2/attachment-0001.htm>


More information about the Dxspider-support mailing list