Add a verbose mode #43

Merged
Ghost merged 3 commits from verbose-mode into master 2019-01-17 14:34:23 +01:00
First-time contributor

Add a verbose function for print detailed output when VERBOSE=1 is set in /etc/evocheck.sh or command line.

Check need to be adapted for use it, IS_TUNE2FS_M5 and IS_OLD_HOME_DIR have been adapted for this PR.

Add a verbose function for print detailed output when **VERBOSE=1** is set in /etc/evocheck.sh or command line. Check need to be adapted for use it, **IS_TUNE2FS_M5** and **IS_OLD_HOME_DIR** have been adapted for this PR.
Contributor
root@evocheck:~# /usr/share/scripts/evocheck.sh             
IS_TUNE2FS_M5 FAILED!                                       
root@evocheck:~# VERBOSE=1 /usr/share/scripts/evocheck.sh   
IS_TUNE2FS_M5 FAILED!                                       
Partition /dev/vda1 has less than 5% reserved blocks!       
                                                            
                                                            
root@evocheck:~#                                            

There is an odd return line. Can we manage to fix that?

```text root@evocheck:~# /usr/share/scripts/evocheck.sh IS_TUNE2FS_M5 FAILED! root@evocheck:~# VERBOSE=1 /usr/share/scripts/evocheck.sh IS_TUNE2FS_M5 FAILED! Partition /dev/vda1 has less than 5% reserved blocks! root@evocheck:~# ``` There is an odd return line. Can we manage to fix that?
benpro reviewed 2019-01-17 10:46:06 +01:00
evocheck.sh Outdated
@ -841,3 +845,3 @@
if [ "$IS_OLD_HOME_DIR" = 1 ]; then
for dir in /home/*; do
stat -c "%n has owner %u resolved as %U" "$dir" | grep -v .bak | grep -q UNKNOWN
stat -c "%n has owner %u resolved as %U" "$dir" | grep -v .bak | grep UNKNOWN | verbose
Contributor

Nice but displays the verbose message before IS_OLD_HOME_DIR FAILED!.

Nice but displays the verbose message before `IS_OLD_HOME_DIR FAILED!`.
Author
First-time contributor

I just fix the odd return line.

I just fix the odd return line.
Author
First-time contributor

I rewrite the IS_OLD_HOME_DIR check with find command.

That simplify the check and fix output order in verbose mode.

I rewrite the IS_OLD_HOME_DIR check with **find** command. That simplify the check and fix output order in verbose mode.
Contributor

LGTM

LGTM
Ghost closed this pull request 2019-01-17 14:34:23 +01:00
Ghost deleted branch verbose-mode 2019-01-17 14:34:27 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evocheck#43
No description provided.