From 886792a1bb30146dedb572b44479feefb3ef64b4 Mon Sep 17 00:00:00 2001 From: adi1090x Date: Fri, 20 Jan 2023 12:30:40 +0530 Subject: [PATCH] Added Sig Script --- profile/create-signature.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 profile/create-signature.sh diff --git a/profile/create-signature.sh b/profile/create-signature.sh new file mode 100755 index 00000000..924955d5 --- /dev/null +++ b/profile/create-signature.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2023 Aditya Shakya + +## Generate sha256sum and gpg signature files +PWD=`pwd` +DIR="$PWD/out" + +if [[ ! -d "$DIR" ]]; then + exit 1 +fi + +RELEASE=`find $DIR -type f -name "archcraft-*.iso" -printf "%f\n"` + +if [[ -n "$RELEASE" ]]; then + echo -e "\n[*] Generating sha256sum for ${RELEASE} ..." + cd "$DIR" && sha256sum ${RELEASE} > ${RELEASE}.sha256sum + if [[ -e "${RELEASE}.sha256sum" ]]; then + echo -e "[*] Checksum generated successfully." + else + echo -e "[!] Failed to generate checksum file." + fi + + echo -e "\n[*] Generating gpg signature for ${RELEASE} ..." + gpg --default-key adi1090x@gmail.com --output ${RELEASE}.sig --detach-sig ${RELEASE} + if [[ -e "${RELEASE}.sig" ]]; then + echo -e "[*] Signature generated successfully.\n" + else + echo -e "[!] Failed to generate signature file.\n" + fi +else + echo -e "\n[!] There's no ISO file in 'files' directory.\n[!] Copy the ISO file in 'files' directory & Run this script again.\n" + exit 1 +fi