mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-12-23 04:25:04 +01:00
Completed error function
This commit is contained in:
parent
a49901eb5b
commit
283abc9d8f
@ -56,6 +56,19 @@ success(){
|
||||
message "${COLOR_GREEN}" "SUCCESS" "$1";
|
||||
}
|
||||
|
||||
error(){
|
||||
message "${COLOR_RED}" "ERROR" "$1 -> Leaving program."
|
||||
if declare -f "destructor" > /dev/null
|
||||
then
|
||||
info "Calling destructor..."
|
||||
destructor
|
||||
else
|
||||
warning "No destructor defined."
|
||||
info "Can be that this script left some waste."
|
||||
fi
|
||||
exit 1;
|
||||
}
|
||||
|
||||
HEADER(){
|
||||
echo
|
||||
echo "${COLOR_YELLOW}The"
|
||||
|
@ -4,14 +4,14 @@
|
||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||
#
|
||||
# shellcheck source=/dev/null # Deactivate SC1090
|
||||
|
||||
source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1)
|
||||
SYSTEM_MEMORY_KB="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
|
||||
info "Start setup of customized core software..."
|
||||
info "Copying templates to home folder..."
|
||||
exit
|
||||
cp -rfv "$TEMPLATE_PATH/." "$HOME"
|
||||
echo "Synchronising packages..."
|
||||
sudo pacman -Syyu
|
||||
cp -rfv "$TEMPLATE_PATH/." "$HOME" || error "Copy templates failed."
|
||||
info "Synchronising packages..."
|
||||
sudo pacman -Syyu || error "Package syncronisation failed."
|
||||
FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
|
||||
SWAP_FILE="/swapfile"
|
||||
FSTAB_FILE="/etc/fstab"
|
||||
|
Loading…
Reference in New Issue
Block a user