Updates to add testing by default; portability fixes

This commit is contained in:
2019-12-07 11:22:09 -06:00
parent b016ae782b
commit 6d1f6390c3
5 changed files with 97 additions and 3 deletions

View File

@@ -1,7 +1,5 @@
#!/bin/bash
source /opt/aninix/Uniglot/Bash/header
unset canaryText
# cscanary=https://cryptostorm.is/canary.txt
# cskeyserver=pgp.mit.edu
@@ -23,11 +21,24 @@ function Usage() {
exit $retcode
}
## Visual Functions ##
# These function creates a visual indicator that a step has happened.
# Borrowed from https://foundation.aninix.net/AniNIX/Uniglot for portability.
function header () {
tput setaf 1; tput bold; echo $@; tput sgr0; return
}
function errorheader () {
tput setaf 1 1>&2; tput bold 1>&2; echo "ERROR:" $@ 1>&2; tput sgr0 1>&2; return
}
function infoheader() {
tput setaf 3; tput bold; echo $@; tput sgr0; return
}
function ConfirmGPGKeys() {
# Try to make sure we either have or can pull the key
if ! gpg2 --fingerprint "$key"; then
gpg --keyserver "$keyserver" --recv-key "$key"
if ! [ $? -eq 0 ] || gpg2 --fingerprint "$key"; then
if ! gpg2 --fingerprint "$key"; then
echo Cannot pull the key: "$key".
exit 1;
fi