Koozali.org: home of the SME Server

startmail template syntax err

Paul

startmail template syntax err
« on: September 26, 2000, 10:19:03 AM »
Hi all!
This newbie is baffled about one of the templates.  I want to learn how to modify the startmail template so I can update my xxx.yi.org domain after a new connection.  I did a chmod +x startmail to make it executable but when I execute it with

./startmail

I get a syntax error near unexpected token 'else'.

Is there something else I should be doing?  

I am also confused about the syntax.  I have searched the FAQs on shell and bash with no result.  For example:

{
$result .= ""# dialup connection; ...\n";
...
}

Would some kind soul point me to the right FAQ or a key {word|phrase} to learn about these shell techniques.

Brian

RE: startmail template syntax err
« Reply #1 on: September 27, 2000, 07:55:17 PM »
Paul,

I use yi.org also and they provide a script that will do the update.
Additionally I edited the ppp template
/etc/e-smith/templates/etc/ppp/ip-up.local/signal-event to run this script
each time it dialed up.  This seems to work most of the time.  Here's a copy
of what I did in my signal-event file

#--------------------------------------------------
# Run these commands whenever a PPP connection is established.
#--------------------------------------------------
/sbin/e-smith/signal-event ip-up $*

/root/sh/dns_update.sh 1>/tmp/dns.txt

Here's a copy of the dns_update.sh script I use.

----------------------------------------------------
#!/bin/sh

user_id="USER ID HERE"
password="PASSWORD HERE"

ip_addr=netstat -rn | egrep ^0.0.0.0 | sed -e "s,.* ,,g" | \
        xargs /sbin/ifconfig | grep "inet.addr" | sed -e "s,.*addr:,," \
        -e "s, .*,,"

now=date

lynx -source -auth=$user_id:$password \
        http://www.yi.org/bin/dyndns.fcgi?ipaddr=$ip_addr | \
        sed -e "s,^,$now: ," -e "s,<.*\?>,,g"

----------------------------------------------------

You may also have to add your signal-event changes to /etc/ppp/ip-up.local
to take immediate affect after updating the template.

I hope this helps.
Brian

Paul

RE: startmail template syntax err
« Reply #2 on: October 12, 2000, 04:53:10 AM »
Thanks for the info Brian.  Your setup works for me.

Sorry for the late response to your suggestion.  

I was trying to use the latest update for e-smith which appear to incorporate ppp into the e-smith console.  It was identified as beta software that included changes that might fix ppp with ddns.  After installing the update I saw entries for my dynamic dns username, password and server in the console setup.  However, e-smith would hang on shutdown occasionally.  I guess it is beta software.  There could be problems with my machine tho.  When I look at some of the logs there are a few messages that indicate problems.

Anyway, you got me working.  Thanks again.

Paul