From ec02adc6fed13a9312805a37fa962cc324fb52eb Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Mon, 11 Feb 2019 10:58:57 +0100
Subject: [PATCH] Log pre / post install

---
 do_postinstall.sh | 4 ++++
 do_preinstall.sh  | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/do_postinstall.sh b/do_postinstall.sh
index 92945b4..7050709 100755
--- a/do_postinstall.sh
+++ b/do_postinstall.sh
@@ -22,12 +22,16 @@ then
     exit 1
 fi
 
+
 if [ -z "`which lxc-ls`" ]
 then
     echo "Please run postinstall on the master"
     exit 1
 fi
 
+logfile="/var/log/`basename $0`_`date +%Y%m%d-%H%M`"
+exec &> >(tee -a "$logfile")
+
 DIR=`dirname $0`
 
 echo "Updating eole"
diff --git a/do_preinstall.sh b/do_preinstall.sh
index c6d979e..6eb0c2d 100755
--- a/do_preinstall.sh
+++ b/do_preinstall.sh
@@ -28,6 +28,9 @@ then
     exit 1
 fi
 
+logfile="/var/log/`basename $0`_`date +%Y%m%d-%H%M`"
+exec &> >(tee -a "$logfile")
+
 echo "Updating eole"
 Maj-Auto
 
@@ -36,4 +39,6 @@ gen_conteneurs
 
 echo "Instanciating server"
 instance
+
+echo "Running diagnostic"
 diagnose -L
-- 
GitLab