[Linux-ham] linux script thing -- not doing WGET. I'm missing something

Basil Gunn basil at pacabunga.com
Sun Feb 9 11:38:54 EST 2014


On Sun, 09 Feb 2014 03:13:05 -0500
Tadd Torborg <tadd at mac.com> wrote:

> I'm looking for help with a bash script, run from /etc/inittab, that
> doesn't seem to be able to WGET.  
> sudo -u pi wget http://www.torborg.com/bpq/$HOSTNAME/bpq32.txt;

3 things I noticed.

You don't have the first line in your script specifying the SHELL
interpreter.

#!/bin/bash

You are relying on an environment variable HOSTNAME which may not be
set. Trying using the command hostname instead ie.

HOST=$(hostname)

As mentioned by R Radford, since you want this script to run after
your network is initialized run it from this directory:

/etc/network/if-up.d/

/Basil n7nix


More information about the Linux-ham mailing list