summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpicodotdev <pico.dev@gmail.com>2018-07-21 21:25:17 +0200
committerpicodotdev <pico.dev@gmail.com>2018-07-21 21:25:17 +0200
commitf9b4a32621b366ec4e6223d0c8cea3c3ec7a3301 (patch)
treec1a5741932a94a28955ae68778c64b20d648b478
parentfbb155814497c59f718e9851d7761f468677b40b (diff)
Make log configurble
Fixes #21
-rw-r--r--alis.conf1
-rw-r--r--alis.sh13
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() {