refactor of daily.sh #4920

Merged
merged 2 commits into from Nov 11, 2016

Projects

None yet

7 participants

@Gorian
Contributor
Gorian commented Nov 1, 2016 edited

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Refactored code of daily.sh. Replaced -ne with "!=", "[" with "[[", enforced better quotes usage, moved daily.php calls to a dedicated function, added support for using $config['log_dir'] from config.php for setting the log directory. Defaults to the value of $config['install_dir'] . '/logs' if $config['log_dir'] is not set. Properly moved all code not in a dedicated function to main().

@Gorian Gorian refactor of daily.sh
Refactored code of daily.sh. Replaced -ne with "!=", "[" with "[[", enforced better quotes usage, moved daily.php calls to a dedicated function, added support for using $config['log_dir'] from config.php for setting the log directory. Defaults to the value of $config['install_dir'] . '/logs' if $config['log_dir'] is not set.
4da2ed2
@Gorian Gorian Add name to author info
Major refactor, added name to authors list :p
1b328ab
@scrutinizer-notifier

The inspection completed: No new issues

@laf
Member
laf commented Nov 3, 2016 edited

Tested and works for me. CentOS 7.

bash --version
GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

What have you tested against @Gorian ?

@laf
laf approved these changes Nov 3, 2016 View changes
@f0o
f0o approved these changes Nov 3, 2016 View changes
@Gorian
Contributor
Gorian commented Nov 3, 2016

@laf also CentOS7, same bash version.

@jonathon-k
Contributor

Works for me as far as I can tell. Debian Jessie
GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu)

@laf
Member
laf commented Nov 8, 2016

I think we need some older distros to test this on.

@murrant
murrant approved these changes Nov 9, 2016 View changes

I can't test older, but I can test newer.
GNU bash, version 4.4.0(1)-release (x86_64-pc-linux-gnu)

@murrant
Contributor
murrant commented Nov 9, 2016

Tested on GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) too (although I didn't have a fully installed librenms there)

@laf
Member
laf commented Nov 9, 2016

Tagged to merge in 48 hours.

@laf laf merged commit 7681580 into librenms:master Nov 11, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Gorian Gorian deleted the Gorian:patch-1 branch Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment