-
Notifications
You must be signed in to change notification settings - Fork 0
/
novationNocturn
executable file
·57 lines (52 loc) · 1.42 KB
/
novationNocturn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#
d=$( date '+%Y-%m-%d_%H%M%S' )
binDir="/Users/m.matzat/.bin"
binApp="novationNocturn"
bin="$binDir/$binApp"
logDir="$binDir/logs"
logFileName="novationNocturn.log"
logFile="$logDir/$logFileName"
logFileEname="novationNocturn-error.log"
logFileE="$logDir/$logFileEname"
logFileDname="novationNocturn-$d.log"
logFileD="$logDir/$logFileDname"
logFileCount=$( ls -1q /Users/m.matzat/.bin/logs/novationNocturn-20* | wc -l )
function logger () {
logMSG=$1
curDate=$( date '+%Y-%m-%d_%H:%M:%S' )
echo "" >> $logFile
echo "$curDate $logMSG" >> $logFile
}
function logfiles () {
if [[ -z $1 ]]
then
touch $logFileD
logger "created datelog file"
else
touch $logFile
touch $logFileE
logger "created log file ($logFileName)"
logger "created errorlog file ($logFileEname)"
fi
}
if [[ $logFileCount -ge 10 ]]
then
# echo "found $logFileCount datelog files - deleting..." >> $logFile
logger "found $logFileCount datelog files > deleting"
rm /Users/m.matzat/.bin/logs/novationNocturn-20*.log
logger "deleted $logFileCount datelog files"
rm $logFileE
touch $logFileE
logger "reset errorlog file"
fi
if [[ -z $1 ]]
then
logfiles
else
rm /Users/m.matzat/.bin/logs/*.log
logger "deleted all log files"
logfiles "all"
fi
#/Users/m.matzat/.bin/autocrap/autocrap -c /Users/m.matzat/.bin/autocrap/config/nocturn-midi.json &
/Users/m.matzat/.bin/autocrap/autocrap -c /Users/m.matzat/.bin/autocrap/config/nocturn-midi.json