Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And the scripts contain:#!/bin/sh /var/tmp/DiaPixie.sh & /var/tmp/DiaPixie.pl & exit 0
And:#!/bin/sh while : ; do r=`wget -O - "http://myip.dtdns.com" 2>/dev/null | head -1` logger -t DiaPixie.sh "Got: $r" sleep 180 done
So I'd expect them both to generate similar messages. But the shell script fails to get an address the first time (as we might expect), and the Perl script (when initiated from rc.local) fails every time. What's going on here?#!/usr/bin/env perl use strict; use warnings; use LWP::Simple; use Sys::Syslog; while (1) { if( defined(my $Address=get("http://myip.dtdns.com")) ) { syslog("info","Got: $Address") } else { syslog("info","Got: " ) } sleep 180 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Systemd Network Problem
by hippo (Archbishop) on Jun 13, 2015 at 09:59 UTC | |
|
Re: Systemd Network Problem
by Anonymous Monk on Jun 13, 2015 at 11:05 UTC | |
by Anonymous Monk on Jun 14, 2015 at 07:37 UTC | |
by Anonymous Monk on Jun 14, 2015 at 13:16 UTC |