Barfs on "unstable" distribution
Seegras opened this issue · 6 comments
$ ./lunar.sh -x
Running: In audit mode (no changes will be made to system)
Auditing: AWS - Recommended Tests
SYSTEM INFORMATION:
./lunar.sh: 274: [: Illegal number: unstable
Virtual: Unknown
Processor: unknown
Machine: x86_64
Vendor: Debian
Name: Linux
Version: unstable
Update: unstable
Stopping: ./lunar.sh needs to be run as root
And I can't see why it needs that (or root), when I just want to check AWS.
There's some old tests in there I had not got around to cleaning up. I've done a quick cleanup, hopefully that should at least get a bit further, e.g.:
$ ./lunar.sh -x
Running: In audit mode (no changes will be made to system)
Auditing: AWS - Recommended Tests
SYSTEM INFORMATION:
Notice: The sysv-rc-conf package may be required by this script but is not present
Virtual: Docker
Processor: unknown
Machine: x86_64
Vendor: Debian
Name: Linux
Version: 10
Update: 0
Warning: ./lunar.sh may need root
AWS CLI is not installed
There's still (or newly?) some bug with the distro, as this has changed, also with the date command ("-j" is BSD, doesn't work on Linux) but it's much better:
./lunar.sh -x
Running: In audit mode (no changes will be made to system)
Auditing: AWS - Recommended Tests
SYSTEM INFORMATION:
./lunar.sh: 281: [: Illegal number: bullseye/sid
Virtual: Unknown
Processor: unknown
Machine: x86_64
Vendor: Debian
Name: Linux
Version: bullseye/sid
Update: bullseye/sid
Warning: ./lunar.sh may need root
Checking: EC2 Recommendations
Secure: EC2 volume vol-0xxxxxxx is attached to an instance [1 Passes]
[snip]
Secure: EC2 volume vol-0yyyyyyyyyyyyyyy is using General Purpose SSD [111 Passes]
date: invalid option -- 'j'
Try 'date --help' for more information.
(standard_in) 1: syntax error
./lunar.sh: 44: [: Illegal number:
[snip]
Warning: RDS instance some-db has a retention period less than 7 [278 Warnings]
usage: aws [options] [ ...] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --query: expected one argument
Warning: RDS instance someotherdb001 is not Multi-AZ enabled [285 Warnings]
[snip]
And then some more complaints about date.
BTW, this can be had as a command:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bullseye/sid
Release: unstable
Codename: sid
Has more params, so you don't need to grep as much.
I think I fixed the date conversion on Linux, will have a look at lsb_release when I get a chance
Looks good. These are the only errors now:
$ ./lunar.sh -x
Running: In audit mode (no changes will be made to system)
Auditing: AWS - Recommended Tests
SYSTEM INFORMATION:
grep: bullseye/sid: No such file or directory
and
usage: aws [options] [ ...] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument --query: expected one argument
Getting there, suspect the grep is due to a OS version/release test somewhere, I'll have to try to find a debian unstable that returns a non number for those fields to see where it's failing, I thought I had found it.
I also saw the patch, thanks for that, I've merged it.
Yeah, I fixed it.