Commit b92ba4d
committed
Fix exit code handling in auto-renew function
The original code had a critical bug where exit codes from certificate
renewal failures were not properly captured due to bash subshell issues
with pipelines. When using a pipeline with '|', each command runs in a
subshell, so changes to variables inside the while loop don't persist
to the parent shell.
This fix:
- Replaces the pipeline approach with a temporary file to avoid subshell issues
- Properly captures and reports failures during certificate renewal
- Ensures that if any app fails to renew, the function will correctly
report failure instead of always reporting success
This is particularly important for automated renewal processes where
proper error reporting is critical for monitoring and alerting.1 parent 658fef4 commit b92ba4d
1 file changed
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
51 | 50 | | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
0 commit comments