Commit cfe39e74 authored by Vladislav's avatar Vladislav

Update try_copy_file_with_checksums, spellcheck fix

parent 43162d03
...@@ -145,8 +145,8 @@ try_copy_file_with_checksums () { ...@@ -145,8 +145,8 @@ try_copy_file_with_checksums () {
|| [[ "${PW_FILESYSTEM}" == "f2fs" ]] \ || [[ "${PW_FILESYSTEM}" == "f2fs" ]] \
|| [[ "${PW_FILESYSTEM}" != "btrfs" ]] || [[ "${PW_FILESYSTEM}" != "btrfs" ]]
then then
checksum1=($(sha256sum "$1")) checksum1="$(sha256sum "$1")"
echo "${checksum1[0]}" > "$2.sha256sum" echo "${checksum1// */}" > "$2.sha256sum"
fi fi
return 0 return 0
else else
...@@ -157,28 +157,28 @@ try_copy_file_with_checksums () { ...@@ -157,28 +157,28 @@ try_copy_file_with_checksums () {
|| [[ "${PW_FILESYSTEM}" == "f2fs" ]] \ || [[ "${PW_FILESYSTEM}" == "f2fs" ]] \
|| [[ "${PW_FILESYSTEM}" != "btrfs" ]] || [[ "${PW_FILESYSTEM}" != "btrfs" ]]
then then
checksum1=($(sha256sum "$1")) checksum1="$(sha256sum "$1")"
if [[ ! -f "$2" ]] ; then if [[ ! -f "$2" ]] ; then
if cp -f "$1" "$2" ; then if cp -f "$1" "$2" ; then
echo "${checksum1[0]}" > "$2.sha256sum" echo "${checksum1// */}" > "$2.sha256sum"
return 0 return 0
else else
return 1 return 1
fi fi
else else
if [[ ! -f "$2.sha256sum" ]] ; then if [[ ! -f "$2.sha256sum" ]] ; then
checksum2=($(sha256sum "$2")) checksum2="$(sha256sum "$2")"
echo "${checksum2[0]}" > "$2.sha256sum" echo "${checksum2// */}" > "$2.sha256sum"
else else
checksum2=$(<"$2.sha256sum") checksum2="$(<"$2.sha256sum")"
fi fi
fi fi
if [[ "${checksum1[0]}" == "${checksum2[0]}" ]] ; then if [[ "${checksum1// */}" == "${checksum2// */}" ]] ; then
return 0 return 0
else else
try_remove_file "$2" try_remove_file "$2"
if cp -f "$1" "$2" ; then if cp -f "$1" "$2" ; then
echo "${checksum1[0]}" > "$2.sha256sum" echo "${checksum1// */}" > "$2.sha256sum"
return 0 return 0
else else
return 1 return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment