Skip to content

jBeale23/inline-checksum

Repository files navigation

Inline-Checksum Logo

Inline-Checksum

A POSIX compliant rework of inline-md5sum, adding support for sha256 and sha512 checksums.

This script is designed to alleviate some of the security concerns of running curl <url> | sh - by validating its input against a checksum before passing it along. It also serves as a convenience wrapper for validating the checksum of an already existing file.

Installation

Clone the repository and run sudo make install to install inline-checksum and its completions for all users.

Alternatively, put inline-checksum anywhere on your $PATH, make sure it's executable, and you're all set. You can manually install tab completions for Bash and Zsh by sourcing the included inline-checksum-completions file in your corresponding shell rc file.

You can run the full test suite by running make test to ensure that all dependencies are met and that things are behaving as you'd expect. After running the test suite, you can clean up the generated log files with make clean.

Usage

Assuming a site provides it, a checksum can be used to verify a downloaded script before running it as follows:

curl -fsSL <url> | inline-checksum [--algorithm[=| ]<sha256|sha512|md5>] <checksum> | sh -

Alternatively, a local file can have its checksum validated as follows:

inline-checksum [--algorithm[=| ]<sha256|sha512|md5>] <checksum> <file>

Uninstallation

If you installed with sudo make install, you can remove inline-checksum and its completions with sudo make uninstall.

Alternatively, just delete inline-checksum and its completion files if you installed it manually.

Origin

Inline-Checksum is adapted and updated from the following source:

  • The work of Cruz Monrreal on inline-md5sum under the terms of the MIT License.

License

Inline-Checksum is licensed under the terms of the MIT License.

About

A tool for quickly validating the checksums of downloaded files.

Resources

License

Stars

Watchers

Forks

Contributors