File indexing completed on 2024-05-12 04:17:32

0001 #!/bin/bash
0002 
0003 # SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0004 #
0005 # SPDX-License-Identifier: BSD-3-Clause
0006 #
0007 # Script to sign bundle files with a GPG key
0008 # GPG key password must be present as simple text file in ~/.gnupg/dkorg-gpg-pwd.txt
0009 
0010 ALLFILES=$(find . -type f -maxdepth 1)
0011 
0012 for BUNDLE in $ALLFILES ; do
0013 
0014     BASENAME=$(basename $BUNDLE)
0015 
0016     if [[ $BASENAME != $(basename $BASH_SOURCE) ]] && [[ $BASENAME != ".." ]] && [[ $BASENAME != "." ]] ; then
0017 
0018         cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -stabv "$BUNDLE" && mv "$BUNDLE.asc" "$BUNDLE.sig"
0019     fi
0020 
0021 done