-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.sh
executable file
·65 lines (47 loc) · 1.05 KB
/
main.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Universidade Federal de Sergipe
# Centro de Ciências Exatas e Tecnológicas
# Departamento de Computação
# Sanity
# Módulo principal
#!/bin/bash
checa_logs() {
if [ -e ~/.sanity/.logs/$1 ]; then
rm ~/.sanity/.logs/$1
fi
}
if [ ! -d ~/.sanity ]; then
mkdir ~/.sanity
fi
if [ ! -d ~/.sanity/.src ]; then
mkdir ~/.sanity/.src
fi
if [ ! -d ~/.sanity/.logs ]; then
mkdir ~/.sanity/.logs
fi
date=~/.sanity/.date.txt
if [ -e $date ]; then
rm $date
fi
cd /opt/sanity
checa_logs .dev-error.txt
checa_logs .ide-error.txt
checa_logs .lib-error.txt
checa_logs .net-error.txt
checa_logs .office-error.txt
checa_logs .util-error.txt
date >> ~/.sanity/.date.txt
hostname=$(hostname)
log=~/.sanity/$hostname.txt
checa_logs $hostname.txt
run-parts --regex .sh modules/network
run-parts --regex .sh modules/development
run-parts --regex .sh modules/office
run-parts --regex .sh modules/ide
run-parts --regex .sh modules/utility
run-parts --regex .sh modules/library
./select.sh
# Envio do log (netcat)
#if [ -e $log ]; then
#./send.sh &
#fi
./notification.sh