diff options
author | davidovski <david@davidovski.xyz> | 2022-02-20 14:32:34 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-02-20 14:32:34 +0000 |
commit | 5e64673025351660b27ad61e215ef38a8f033c85 (patch) | |
tree | 87f8f11c38a447835e546fc8c579308e88d4ebee /src/validate.sh | |
parent | 8f02115e50573be0a5c6653f2a4a2bb6d7459911 (diff) |
added bootstrapping
Diffstat (limited to 'src/validate.sh')
-rw-r--r-- | src/validate.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/validate.sh b/src/validate.sh index b2c0b21..42530bb 100644 --- a/src/validate.sh +++ b/src/validate.sh @@ -23,3 +23,36 @@ validate_sig () { done return 1 } + + +keyimport () { + local keychain=${SYSROOT}${KEYCHAIN_DIR} + mkdir -p $keychain + case "$#" in + "2") + local name=$1 + local url=$2 + + local keyfile=$keychain/$name.pub + printf "${BLUE}Importing $name...${GREEN}" + download_file $keyfile $url && + printf "${CHECKMARK}\n" || + printf "${RED}Error occured!\n" + ;; + "1") + local keyname=$1 + + # account for a glob input + set +o noglob + for key in ${KEYCHAIN_DIR}/$keyname.pub; do + name=$(basename -s .pub $key) + cp $key $keychain + printf "${GREEN}Imported ${LIGHT_GREEN}$name ${GREEN}to ${SYSROOT}\n" + done + ;; + *) + ls $keychain + ;; + esac + set +o noglob +} |