Update debian-v3.sh

This commit is contained in:
tteckster 2022-04-25 10:21:16 -04:00 committed by GitHub
parent dc446ad109
commit f72594e554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,15 @@ shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit' alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR trap die ERR
function error_exit() {
trap - ERR
local reason="Unknown failure occured."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
function msg_info() { function msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..." echo -ne " ${HOLD} ${YW}${msg}..."
@ -37,15 +46,6 @@ function msg_ok() {
echo -e "${BFR} ${CM} ${GN}${msg}${CL}" echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
} }
function error_exit() {
trap - ERR
local reason="Unknown failure occured."
local msg="${1:-$reason}"
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
echo -e "$flag $msg" 1>&2
exit $EXIT
}
while true; do while true; do
read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
case $yn in case $yn in