diff options
author | ath3 <ha05190@protonmail.com> | 2019-06-27 02:42:27 +0200 |
---|---|---|
committer | ath3 <ha05190@protonmail.com> | 2019-06-27 02:48:04 +0200 |
commit | c2fbdfdeb3459fccc9fda5b7311447ac515ac063 (patch) | |
tree | f8edd8064ee205f305a6efd3ca5b48e3dfc26ca7 /plugins/checksum | |
parent | 900ffbebc7c73942be779d1bc10b40df3c27cebb (diff) | |
download | nnn-c2fbdfdeb3459fccc9fda5b7311447ac515ac063.tar.gz |
Remove unneeded check from checksum plugin
Diffstat (limited to 'plugins/checksum')
-rwxr-xr-x | plugins/checksum | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/checksum b/plugins/checksum index 488f9f6..d593a47 100755 --- a/plugins/checksum +++ b/plugins/checksum @@ -15,7 +15,6 @@ selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection resp=f chsum=md5 -ischksum=0 checksum_type() { @@ -49,16 +48,13 @@ else for chks in md5 sha1 sha224 sha256 sha384 sha512 do if [ "$(echo "$1" | grep \.${chks}$)" ]; then - ischksum=1 ${chks}sum -c < "$1" read exit fi done - if [ $ischksum -eq 0 ]; then - checksum_type - file=$(basename "$1").$chsum - ${chsum}sum "$1" > "$file" - fi + checksum_type + file=$(basename "$1").$chsum + ${chsum}sum "$1" > "$file" fi fi |