Shell Script Execution Problem

Discussion in 'Programming/Scripts' started by giganet, Dec 23, 2008.

  1. giganet

    giganet New Member

    Hi I am working on the HowTo Tutorial: http://www.howtoforge.com/virtual_postfix_mysql_quota_courier_p4

    After creating the file below in '/usr/local/sbin' I then set it's permission
    as: 'chmod 755 /usr/local/sbin/sa_rules_update.sh'

    When I try to execute the script with either of the two following lines
    '/usr/local/sbin/sa_rules_update.sh'
    OR
    'sa_rules_update.sh'
    The CLI just displays an empty line and doesn't print the contents of the script, I then run 'ctrl-c' to stop the process.

    Shouldn't the script immediately execute, or am I not waiting long enough?

    The Shell Script
    Code:
    #!/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/71_sare_redirect_pre3.0.0.cf[/URL] -O 71_sare_redirect_pre3.0.0.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_bayes_poison_nxm.cf[/URL] -O 70_sare_bayes_poison_nxm.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_html.cf[/URL] -O 70_sare_html.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_html4.cf[/URL] -O 70_sare_html4.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_html_x30.cf[/URL] -O 70_sare_html_x30.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_header0.cf[/URL] -O 70_sare_header0.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_header3.cf[/URL] -O 70_sare_header3.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_header_x30.cf[/URL] -O 70_sare_header_x30.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_specific.cf[/URL] -O 70_sare_specific.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_adult.cf[/URL] -O 70_sare_adult.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/72_sare_bml_post25x.cf[/URL] -O 72_sare_bml_post25x.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/99_sare_fraud_post25x.cf[/URL] -O 99_sare_fraud_post25x.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_spoof.cf[/URL] -O 70_sare_spoof.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_random.cf[/URL] -O 70_sare_random.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_oem.cf[/URL] -O 70_sare_oem.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_genlsubj0.cf[/URL] -O 70_sare_genlsubj0.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_genlsubj3.cf[/URL] -O 70_sare_genlsubj3.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_genlsubj_x30.cf[/URL] -O 70_sare_genlsubj_x30.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_unsub.cf[/URL] -O 70_sare_unsub.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/70_sare_uri.cf[/URL] -O 70_sare_uri.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://mywebpages.comcast.net/mkettler/sa/antidrug.cf[/URL] -O antidrug.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.timj.co.uk/linux/bogus-virus-warnings.cf[/URL] -O bogus-virus-warnings.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.yackley.org/sa-rules/evilnumbers.cf[/URL] -O evilnumbers.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.stearns.org/sa-blacklist/random.current.cf[/URL] -O random.current.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/88_FVGT_body.cf[/URL] -O 88_FVGT_body.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/88_FVGT_rawbody.cf[/URL] -O 88_FVGT_rawbody.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/88_FVGT_subject.cf[/URL] -O 88_FVGT_subject.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/88_FVGT_headers.cf[/URL] -O 88_FVGT_headers.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/88_FVGT_uri.cf[/URL] -O 88_FVGT_uri.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/99_FVGT_DomainDigits.cf[/URL] -O 99_FVGT_DomainDigits.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/99_FVGT_Tripwire.cf[/URL] -O 99_FVGT_Tripwire.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.rulesemporium.com/rules/99_FVGT_meta.cf[/URL] -O 99_FVGT_meta.cf &> /dev/null
    cd /etc/spamassassin/ &> /dev/null && /usr/bin/wget [URL]http://www.nospamtoday.com/download/mime_validate.cf[/URL] -O mime_validate.cf &>
    /dev/null/etc/init.d/amavis restart &> /dev/null
    exit 0
    Thanks in advance for your help with this...

    Regards
     
  2. falko

    falko Super Moderator Howtoforge Staff

    It can take some time until the scripts has downloaded the latest recipes.

    However, there's now an easier method of updating the recipes: just run

    Code:
    sa-update --no-gpg
     

Share This Page