forked from SouthbankSoftware/dbkoda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsupportBundle.sh
41 lines (39 loc) · 981 Bytes
/
supportBundle.sh
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
THISDIR=$PWD
BUNDLE=${THISDIR}/dbKodaSupportBundle.tar
GBUNDLE=${BUNDLE}.gz
if [ -f ${GBUNDLE} ]; then
echo "Deleting existing file ${GBUNDLE}"
rm ${GBUNDLE}
fi
OS=`uname -a|cut -f 1 -d ' '`
if [ ${OS} = 'Darwin' ];then
OSX=1
else
OSX=0
fi
mongo --version >>/tmp/$$.tmp
uname -a >>/tmp/$$.tmp
if [ ${OSX} -eq 1 ]; then
echo "Running on a mac"
#system_profiler -detaillevel mini -timeout 2 >/tmp/$$.tmp
sw_vers >>/tmp/$$.tmp
if [ -d ~/Library/Application\ Support/dbKoda/logs ];then
cd ~/Library/Application\ Support/dbKoda/logs
tar cvf ${BUNDLE} `ls -t |head -6`
fi
else
echo "Running on Linux"
if [ -d ~/.config/dbKoda/logs ];then
cd ~/.config/dbKoda/logs
tar cvf ${BUNDLE} `ls -t |head -6`
fi
fi
if [ -d ~/.dbKoda ];then
cd ~/.dbKoda
tar rvf ${BUNDLE} state* config*
fi
cd /tmp
tar rvf ${BUNDLE} $$.tmp
gzip ${BUNDLE}
echo
echo "Please forward ${GBUNDLE} to [email protected]"