mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-22 15:11: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";
|
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(){
|
HEADER(){
|
||||||
echo
|
echo
|
||||||
echo "${COLOR_YELLOW}The"
|
echo "${COLOR_YELLOW}The"
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||||
#
|
#
|
||||||
# shellcheck source=/dev/null # Deactivate SC1090
|
# shellcheck source=/dev/null # Deactivate SC1090
|
||||||
|
|
||||||
source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1)
|
source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1)
|
||||||
SYSTEM_MEMORY_KB="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
|
SYSTEM_MEMORY_KB="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
|
||||||
info "Start setup of customized core software..."
|
info "Start setup of customized core software..."
|
||||||
info "Copying templates to home folder..."
|
info "Copying templates to home folder..."
|
||||||
exit
|
cp -rfv "$TEMPLATE_PATH/." "$HOME" || error "Copy templates failed."
|
||||||
cp -rfv "$TEMPLATE_PATH/." "$HOME"
|
info "Synchronising packages..."
|
||||||
echo "Synchronising packages..."
|
sudo pacman -Syyu || error "Package syncronisation failed."
|
||||||
sudo pacman -Syyu
|
|
||||||
FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
|
FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
|
||||||
SWAP_FILE="/swapfile"
|
SWAP_FILE="/swapfile"
|
||||||
FSTAB_FILE="/etc/fstab"
|
FSTAB_FILE="/etc/fstab"
|
||||||
|
Loading…
Reference in New Issue
Block a user