Closed sniglet closed 11 years ago
This issue can be closed. It's a compatibility thing...."sh autosnort.sh" fails....bash "autosnort.sh" succeeds.
(unless you want to put a test in there for which shell is in use.)
My apologies for not responding sooner, but yeah, I noticed this issue a long, long time ago. If you call the script with /bin/sh or /bin/dash (basic bourne shell) the script fails to run. This is because the function/subroutine responsible for pulling updates is BASH specific; there's no function definition options in /bin/sh at all.
A possible work-around would be to just replace the function with "apt-get -y install [install items here]" or yum -y "[install items here]" for every line that refers to the install_packages function, if your goal is to make the script able to be run via sh or dash.
Regards,
DA
On Thu, Apr 18, 2013 at 4:54 PM, sniglet notifications@github.com wrote:
This issue can be closed. It's a compatibility thing...."sh autosnort.sh" fails....bash "autosnort.sh" succeeds.
(unless you want to put a test in there for which shell is in use.)
— Reply to this email directly or view it on GitHubhttps://github.com/da667/Autosnort/issues/12#issuecomment-16609075 .
when does reality end? when does fantasy begin?
OS: Ubunto 12.04, script output shows:
The following packages have been kept back: linux-headers-server linux-image-server linux-server 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Packages and repos are fully updated. Grabbing required packages via apt-get. ./autosnort-ubuntu-04-14-2013.sh: 129: ./autosnort-ubuntu-04-14-2013.sh: Syntax error: "(" unexpected
It doesn't seem to like the multi-package string passed to install_packages