Skip to content

Commit

Permalink
Archive disabled_list_update()
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Mar 7, 2022
1 parent dcd0c40 commit 13abe14
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions dev/easytls-code-archive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,48 @@ import_key ()
* DISABLED *" ;;





# Update disabled-list footer and hash
# TODO: is footer necessary ?
disabled_list_update ()
{
die "DISABLE - disabled_list_update"

# Update time-stamp
update_date="${local_date_ascii}"

# back up
"${EASYTLS_CP}" "${EASYTLS_DISABLED_LIST}" "${EASYTLS_DISABLED_LIST}.tmp"

update_text="# Updated: ${update_date} -- ${action}: ${name}"
"${EASYTLS_SED}" -i -e '/^# Updated: .*$/d' "${EASYTLS_DISABLED_LIST}" || {
error_msg "disabled_list_update_and_hash - sed failed"
return 1
}

# Create temp record file
"${EASYTLS_PRINTF}" '%s\n' "${update_text}" > "${EASYTLS_TEMP_RECORD}" || {
error_msg "disabled_list_update_and_hash - printf failed"
return 1
}

# Append temp record to disabled-list
"${EASYTLS_CP}" "${EASYTLS_DISABLED_LIST}" "${EASYTLS_TEMP_LIST}" || {
error_msg "disabled_list_update_and_hash - cp failed"
return 1
}

"${EASYTLS_CAT}" "${EASYTLS_TEMP_LIST}" "${EASYTLS_TEMP_RECORD}" > \
"${EASYTLS_DISABLED_LIST}" || {
error_msg "disabled_list_update_and_hash - cat failed"
return 1
}

# Remove temp files
"${EASYTLS_RM}" -f "${EASYTLS_TEMP_LIST}" "${EASYTLS_TEMP_RECORD}" \
"${EASYTLS_DISABLED_LIST}.tmp"
} # => disabled_list_update ()


1 comment on commit 13abe14

@TinCanTech
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.