Commit cd5a5c00 authored by Medicean's avatar Medicean Committed by Medicean

(Enhance: Core/CMDLinux) support filehash

parent d7b6e85c
...@@ -80,6 +80,21 @@ module.exports = (arg1, arg2, arg3) => ({ ...@@ -80,6 +80,21 @@ module.exports = (arg1, arg2, arg3) => ({
}, },
filehash: { filehash: {
_: ``.replace(/\n\s+/g, ''), _: `command_exists() { command -v "$@" > /dev/null 2>&1; };
if command_exists md5sum; then
asmd5=$(md5sum #{path}|awk '{print $1}');
echo -n "MD5\\t$asmd5\\n";
elif command_exists busybox && busybox --list-modules | grep -q md5sum; then
asmd5=$(busybox md5sum #{path}|awk '{print $1}');
echo -n "MD5\\t$asmd5\\n";
fi;
if command_exists sha1sum; then
assha1=$(sha1sum #{path}|awk '{print $1}');
echo -n "SHA1\\t$assha1\\n";
elif command_exists busybox && busybox --list-modules | grep -q sha1sum; then
assha1=$(busybox sha1sum #{path}|awk '{print $1}');
echo -n "SHA1\\t$assha1\\n";
fi;
`.replace(/\n\s+/g, ''),
}, },
}) })
\ No newline at end of file
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