Skip to content

Commit

Permalink
fixed typos; add log file rotation and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
WanWizard committed Mar 2, 2019
1 parent 26bfea1 commit 8052e64
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/enigma2.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ while : ; do

# start enigma
sync
if [ $ENIGMA_DEBUG_LVL -lt 4 ]; then
if [ $DEBUG_LVL -lt 4 ]; then
LD_PRELOAD=$LIBS ENIGMA_DEBUG_LVL=$DEBUG_LVL @bindir@/enigma2
else
LD_PRELOAD=$LIBS ENIGMA_DEBUG_LVL=$DEBUG_LVL @bindir@/enigma2 > /home/root/enigma.log 2&>1
# remove old logfiles
keep=5;
for file in `ls -t /home/root/enigma.*.debuglog`; do let "keep--"; if [ "$keep" -lt "0" ]; then rm $file; fi; done
# todays log file
file="/home/root/enigma.$(date +%Y%m%d).debuglog"
LD_PRELOAD=$LIBS ENIGMA_DEBUG_LVL=$DEBUG_LVL @bindir@/enigma2 >> $file 2>&1
fi


Expand Down

0 comments on commit 8052e64

Please sign in to comment.