Skip to content

Commit

Permalink
Cleaner code
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy <[email protected]>
  • Loading branch information
TommyTran732 authored Jun 30, 2024
1 parent cf257b3 commit 8121d41
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions usr/local/bin/certbot-ocsp-fetcher
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# This file is the same as https://github.com/GrapheneOS/infrastructure/blob/main/certbot-ocsp-fetcher
# but with an extra line to restore SELinux context
# This file is the same as https://github.com/tomwassenberg/certbot-ocsp-fetcher
# but with extra logic to restore SELinux context

# Unofficial Bash strict mode
set \
Expand Down Expand Up @@ -577,7 +577,12 @@ fetch_ocsp_response() {
# If arrived here status was good, so move OCSP staple file to definitive
# folder
mv "${temp_output_dir}/${lineage_name}.der" "${OUTPUT_DIR}/"
restorecon -R "${OUTPUT_DIR}/"

# Restore SELinux context on SELinux systems
if [ -f /usr/sbin/restorecon ]; then
restorecon "${OUTPUT_DIR}/${lineage_name}.der"
fi

lineages_processed["${lineage_name}"]=updated
}

Expand Down

0 comments on commit 8121d41

Please sign in to comment.