1#!/bin/bash
2# description: get sys log and pc config info
3
4#check whether the user is root
5
6if [ `id | awk '{print $1}'` != "uid=0(root)" ]
7then
8    echo -e "You must run the process by root!"
9    echo -e "Finished, press any key to exit."
10    read -n 1
11    clear
12    exit
13fi
14
15SCRIPTPATH=$(cd $(dirname $0); pwd)
16INSTALLPATH="${SCRIPTPATH}/.."
17
18if [ -f /etc/issue ]
19then
20   cp -f /etc/issue .
21fi
22
23if [ -d ${INSTALLPATH}/log ]
24then 
25   cp -rf ${INSTALLPATH}/log .
26   mv -f log ourlog
27fi
28
29
30if [ -d ${INSTALLPATH}/config/log ]
31then
32   cp -rf ${INSTALLPATH}/config/log .
33   mv -f log logconfig
34fi
35
36if [ -d /var/log ]
37then
38   cp -rf /var/log .
39   mv -f log systemlog
40fi
41
42tar czf SysInfo.tar.gz issue ourlog logconfig systemlog
43
44rm -f issue
45rm -rf ourlog
46rm -rf logconfig
47rm -rf systemlog
48