27 lines
304 B
Plaintext
27 lines
304 B
Plaintext
|
err() {
|
||
|
echo $1
|
||
|
echo "exiting.."
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
input() {
|
||
|
local input
|
||
|
local found="0"
|
||
|
echo "$1 $2"
|
||
|
read input
|
||
|
for i in $2; do
|
||
|
if [ "$i" == "$input" ]; then
|
||
|
found=1
|
||
|
fi
|
||
|
done
|
||
|
if [ "$found" == "0" ]; then
|
||
|
err "$input: $3"
|
||
|
return 1
|
||
|
fi
|
||
|
output="$input"
|
||
|
}
|
||
|
|
||
|
header() {
|
||
|
echo ""
|
||
|
echo "#### $1"
|
||
|
}
|