Results 1 to 8 of 8

Thread: Ok. Not a security question but..

  1. #1
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323

    Talking Ok. Not a security question but..

    A script, for qmail, I was working on for one of my linux boxes always gives the error:

    scriptname: line 108: syntax error: unexpected end of file

    Line 108 is the last line of the script and I've set it up exactly as I've seen but it always gives this.

    The syntax for the rest of the script is correct and works on Solaris and RH ok.

    Anyone got any idears?

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Posts
    412
    Don't suppose you manipulated that script in a windows file editor, they've been known to put stupid EOF's where thier not needed - probably not your answer though.

  3. #3
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323
    Nope. It was entirely typed in using vi. Its an odd thing. Never seen it before and the script is as its supposed to be. So I'm at a total loss as to why its responding the way it is.

  4. #4
    Hmmm. In C++, that message usually means you forgot a closing brace. For example

    {
    DoSomething()
    {
    DoAnotherThing()
    }

    Hope that helps
    Q: Why do ducks have big flat feet?
    A: To stamp out forest fires

    Q: Why do elephants have big flat feet?
    A: To stamp out flaming ducks

  5. #5
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323
    Nope. Not a C/C++ proggie.. its shell script. =(. This has me stumped. Makes no sense at all.

  6. #6
    Computer Forensics
    Join Date
    Jul 2001
    Posts
    672
    mittens: what functions are taking place in line 108 or calling a function there ?
    Antionline in a nutshell
    \"You\'re putting the fate of the world in the hands of a bunch of idiots I wouldn\'t trust with a potato gun\"

    Trust your Technolust

  7. #7
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Location
    Redondo Beach, CA
    Posts
    7,323
    This is the script:


    #!/bin/sh

    # For Red Hat chkconfig
    # chkconfig: - 30 80
    # description: the qmail MTA

    PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
    export PATH

    QMAILDUID=`id -u qmaild`
    NOFILESGID=`id -g qmaild`

    case "$1" in
    start)
    echo "Starting qmail"
    if svok /service/qmail-send ; then
    svc -u /service/qmail-send
    else
    echo qmail-send service not running
    fi
    if svok /service/qmail-smtpd ; then
    svc -u /service/qmail-smtpd
    else
    echo qmail-smtpd service not running
    fi
    if [ -d /var/lock/subsys ]; then
    touch /var/lock/subsys/qmail
    fi
    ;;
    stop)
    echo "Stopping qmail..."
    echo " qmail-smtpd"
    svc -d /service/qmail-smtpd
    echo " qmail-send"
    svc -d /service/qmail-send
    if [ -f /var/lock/subsys/qmail ]; then
    rm /var/lock/subsys/qmail
    fi
    ;;
    stat)
    svstat /service/qmail-send
    svstat /service/qmail-send/log
    svstat /service/qmail-smtpd
    svstat /service/qmail-smtpd/log
    qmail-qstat
    ;;
    doqueue|alrm|flush)
    echo "Sending ALRM signal to qmail-send."
    svc -a /service/qmail-send
    ;;
    queue)
    qmail-qstat
    qmail-qread
    ;;
    reload|hup)
    echo "Sending HUP signal to qmail-send."
    svc -h /service/qmail-send
    ;;
    pause)
    echo "Pausing qmail-send"
    svc -p /service/qmail-send
    echo "Pausing qmail-smtpd"
    svc -p /service/qmail-smtpd
    ;;
    cont)
    echo "Continuing qmail-send"
    svc -c /service/qmail-send
    echo "Continuing qmail-smtpd"
    svc -c /service/qmail-smtpd
    ;;
    restart)
    echo "Restarting qmail:"
    echo "* Stopping qmail-smtpd."
    svc -d /service/qmail-smtpd
    echo "* Sending qmail-send SIGTERM and restarting."
    svc -t /service/qmail-send
    echo "* Restarting qmail-smtpd."
    svc -u /service/qmail-smtpd
    ;;
    cdb)
    tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
    chmod 644 /etc/tcp.smtp.cdb
    echo "Reloaded /etc/tcp.smtp."
    ;;
    help)
    cat <<HELP
    stop -- stops mail service (smtp connections refused, nothing goes out)
    start -- starts mail service (smtp connection accepted, mail can go out)
    pause -- temporarily stops mail service (connections accepted, nothing leaves)
    cont -- continues paused mail service
    stat -- displays status of mail service
    cdb -- rebuild the tcpserver cdb file for smtp
    restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
    doqueue -- sends qmail-send ALRM, scheduling queued messages for delivery
    reload -- sends qmail-send HUP, rereading locals and virtualdomains
    queue -- shows status of queue
    alrm -- same as doqueue
    flush -- same as doqueue
    hup -- same as reload
    HELP
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"
    exit 1
    ;;
    esac

    exit 0

  8. #8
    Computer Forensics
    Join Date
    Jul 2001
    Posts
    672
    echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|paus
    e|cont|cdb|queue|help}"
    exit 1
    ;;
    esac <<----------------- it doesn't know what to do with this.

    exit 0
    Antionline in a nutshell
    \"You\'re putting the fate of the world in the hands of a bunch of idiots I wouldn\'t trust with a potato gun\"

    Trust your Technolust

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •