From f9b4a32621b366ec4e6223d0c8cea3c3ec7a3301 Mon Sep 17 00:00:00 2001 From: picodotdev Date: Sat, 21 Jul 2018 21:25:17 +0200 Subject: Make log configurble Fixes #21 --- alis.conf | 1 + alis.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/alis.conf b/alis.conf index 943873d..c42b0da 100644 --- a/alis.conf +++ b/alis.conf @@ -1,5 +1,6 @@ # init KEYS="es" +LOG="false" # partition DEVICE="/dev/sda" diff --git a/alis.sh b/alis.sh index bb93966..2c80081 100644 --- a/alis.sh +++ b/alis.sh @@ -78,6 +78,7 @@ function configuration_install() { function check_variables() { check_variables_value "KEYS" "$KEYS" + check_variables_boolean "LOG" "$LOG" check_variables_value "DEVICE" "$DEVICE" check_variables_boolean "LVM" "$LVM" check_variables_list "FILE_SYSTEM_TYPE" "$FILE_SYSTEM_TYPE" "ext4 btrfs xfs" @@ -164,8 +165,10 @@ function init() { } function init_log() { - exec > >(tee -a $LOG) - exec 2> >(tee -a $LOG >&2) + if [ "$LOG" == "true" ]; then + exec > >(tee -a $LOG) + exec 2> >(tee -a $LOG >&2) + fi set -o xtrace } @@ -823,8 +826,10 @@ function packages_aur() { } function terminate() { - mkdir -p /mnt/var/log - cp "$LOG" "/mnt/var/log/$LOG" + if [ "$LOG" == "true" ]; then + mkdir -p /mnt/var/log + cp "$LOG" "/mnt/var/log/$LOG" + fi } function end() { -- cgit v1.2.3