#!/bin/bash

# Date: 2020-05-24T00:47Z

# Author: Steven Baltakatei Sandoval

# Description: A bash script that creates a gpg signature using
# default key.

# Usage: bksign [ file ]

FILEIN="$1"

# Check that provided argument is a file.
if ! [ -f "$FILEIN" ]; then
    echo "ERROR: Invalid filename provided." 2>&1;
    exit 1;
fi

# Determine output file name
FILEOUT="$FILEIN".asc
gpg  --armor --verbose --output "$FILEOUT" --detach-sign "$FILEIN"

exit 1