61 lines
891 B
Bash
61 lines
891 B
Bash
#!/usr/bin/env bash
|
|
|
|
inverse="$(tput setab 7)$(tput setaf 0)"
|
|
success="$(tput setab 2)$(tput bold)"
|
|
error="$(tput setab 1)$(tput bold)"
|
|
underline=$(tput smul)
|
|
reset=$(tput sgr0)
|
|
|
|
# Set pipefail option
|
|
set -o pipefail
|
|
|
|
title () {
|
|
read title
|
|
echo " ****"
|
|
echo "***** $title *****"
|
|
echo "*****"
|
|
}
|
|
|
|
subtitle () {
|
|
read title
|
|
echo "***** $title"
|
|
}
|
|
|
|
footer () {
|
|
echo "***** *****"
|
|
echo "***** END OF SCRIPT *****"
|
|
echo " **** ****"
|
|
}
|
|
|
|
section () {
|
|
read title
|
|
echo ":"
|
|
echo ":<*> $title..."
|
|
}
|
|
|
|
result () {
|
|
local exit_code=$?
|
|
|
|
if [ $exit_code -eq 0 ]
|
|
then
|
|
echo ":<=> $success Ok $reset*****"
|
|
else
|
|
echo ":<!> $error Error $reset*****"
|
|
fi
|
|
}
|
|
|
|
output () {
|
|
while read line
|
|
do
|
|
#[ -z "$line" ] && break
|
|
echo ": | $line"
|
|
done
|
|
}
|
|
|
|
output::warning () {
|
|
while read line
|
|
do
|
|
echo ":<!> $line"
|
|
done
|
|
}
|