diff options
author | picodotdev <pico.dev@gmail.com> | 2018-07-21 21:25:17 +0200 |
---|---|---|
committer | picodotdev <pico.dev@gmail.com> | 2018-07-21 21:25:17 +0200 |
commit | f9b4a32621b366ec4e6223d0c8cea3c3ec7a3301 (patch) | |
tree | c1a5741932a94a28955ae68778c64b20d648b478 /alis.sh | |
parent | fbb155814497c59f718e9851d7761f468677b40b (diff) |
Make log configurble
Fixes #21
Diffstat (limited to 'alis.sh')
-rw-r--r-- | alis.sh | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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() { |