From: Colin P. Mccabe Date: Thu, 20 Dec 2018 00:11:14 +0000 (-0800) Subject: Remove passtool.sh X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95e5a18f65e0676d5ce2e037caa14b75746275fd;p=cmccabe-bin Remove passtool.sh Remove passtool.sh since vault should be used instead. --- diff --git a/passtool.sh b/passtool.sh deleted file mode 100755 index ce34965..0000000 --- a/passtool.sh +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env bash - -die() { - echo $1 - exit 1 -} - -usage() -{ - cat < "${dest}" -} - -decrypt_file() { - dest="${1}" - src="${2}" - openssl enc -d -aes-256-ecb -k "${PASSWORD}" < "${src}" > "${dest}" -} - -SEARCH_PATTERN="" -PLAINTEXT=0 -while getopts "f:hps:" flag; do - case $flag in - f) PASSWORD_PATH="${OPTARG}";; - h) usage; exit 0;; - p) PLAINTEXT=1;; - s) SEARCH_PATTERN="${OPTARG}";; - *) echo; usage; exit 1;; - esac -done - -[[ -z ${PASSWORD_PATH} ]] && die "You must specify a password file path with -f" -[[ -f ${PASSWORD_PATH} ]] || die "No regular file found at ${PASSWORD_PATH}" - -if [[ -z ${PASSWORD} ]]; then - read -s -p "enter password: " PASSWORD -fi -if [[ ${PLAINTEXT} -eq 1 ]]; then - if [[ ${SEARCH_PATTERN} != "" ]]; then - die "You may not specify both -s and -p." - fi - encrypt_new_file -elif [[ ${SEARCH_PATTERN} != "" ]]; then - search_existing_file -else - edit_existing_file -fi -