# LOGS settings v0.1.6 (2023-06-20 by MIBonk)
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#See the GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software Foundation,
#Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# set logs...
if [[ ! -e "$BACKUPFOLDER" ]]; then
mkdir -p "$BACKUPFOLDER"
fi
LOG="$BACKUPFOLDER/$MUVERSION-$FAZIT.log"
if [ ! -f $LOG ]; then
cat $thisdir/../config/LOGO > $LOG
echo $VERSION >> $LOG
if [ -z $MODELID ]; then
. $thisdir/../config/LOCALS > /dev/null
fi
echo -ne "______________________________________________________________________\n" >> $LOG
echo -ne "\nNOT FOR COMMERCIAL USE - IF YOU BOUGHT THIS YOU GOT RIPPED OFF\n\n" >> $LOG
echo -ne "Logging_$MUVERSION-$TRAINVERSION-$FAZIT:\n" >> $LOG
echo -ne "PN: $PARTNO - HW Number: $HWNO\n" >> $LOG
echo -ne "Metainfo2 Variant (Variant2): $VARIANT\n" >> $LOG
echo -ne "EEPROM Variant (Variant1): $COMPONENT\n" >> $LOG
echo -ne "Parameter set part number: $DATASETV\n" >> $LOG
echo -ne "Coding: $CODING\n" >> $LOG
echo -ne "Car Model: $MODEL\n" >> $LOG
echo -ne "VIN MIB: $VINMIB - VIN car: $VINCAR\n" >> $LOG
echo -ne "______________________________________________________________________\n" >> $LOG
echo -ne "\nls --> " >> $LOG
ls -als $thisdir/.. >> $LOG
echo -ne "______________________________________________________________________\n" >> $LOG
fi
ERROR() {
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo -ne " -> done
\n" | $TEE -a $LOG
else
echo -ne " -> failed!\n"| $TEE -a $LOG
fi
}
return 2> /dev/null