Add condition on bkctld check-canary #67

Open
opened 2023-06-21 18:10:08 +02:00 by isaid · 2 comments

Hey,

I suggest adding a condition to skip jail which doesn't contain any incs policy or/and jail which had specific context.
I think is a false output to get error on jails which hasn't incs policy.

Idea :

  • add condition elif :
  • inc_test=$( bkctld status | awk '$4 ~ /0\/0/ {print $0}' | echo $? ); if [ $inc_test -eq 0 ];then echo " INFO - jail doesn't expect any inc"; fi
Hey, I suggest adding a condition to skip jail which doesn't contain any incs policy or/and jail which had specific context. I think is a false output to get error on jails which hasn't incs policy. Idea : - add condition elif : * `inc_test=$( bkctld status | awk '$4 ~ /0\/0/ {print $0}' | echo $? ); `**if [ $inc_test -eq 0 ];then echo " INFO - jail doesn't expect any inc"; fi**
Owner

Hello there,

Be careful, in your example, inc_test won't contain the status code of the awk command.

inc_test=$( bkctld status  | awk '$4 ~ /0\/0/ {print $0}' | echo $? )

For example:

true
inc_test=$(false | false | echo $?)

inc_test will always be 0 (OK).

false
inc_test=$(false | false | echo $?)

inc_test will always be 1 (not OK).

You probably want to do something like this:

inc_test=$( bkctld status  | awk '$4 ~ /0\/0/ {print $0}' > /dev/null; echo $? )
Hello there, Be careful, in your example, `inc_test` won't contain the status code of the `awk` command. ``` inc_test=$( bkctld status | awk '$4 ~ /0\/0/ {print $0}' | echo $? ) ``` For example: ``` true inc_test=$(false | false | echo $?) ``` `inc_test` will always be 0 (OK). ``` false inc_test=$(false | false | echo $?) ``` `inc_test` will always be 1 (not OK). You probably want to do something like this: ``` inc_test=$( bkctld status | awk '$4 ~ /0\/0/ {print $0}' > /dev/null; echo $? ) ```
Author

okay, thanks for helping me out.

Have you got any opinion about my idea ?

okay, thanks for helping me out. Have you got any opinion about my idea ?
mtrossevin added the
enhancement
bkctld
labels 2023-11-28 17:58:48 +01:00
Sign in to join this conversation.
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/evobackup#67
No description provided.