-
Notifications
You must be signed in to change notification settings - Fork 2
/
email.sh
50 lines (40 loc) · 1.22 KB
/
email.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
#!/bin/bash
# ESCRITO POR SANSAO
#if [ `whoami` != "zabbix" ] ; then
# echo ""
# echo "voce deve estar logado com o user zabbix para continuar."
# echo "Se nunca logou com ele, execute o comando em seguida logue"
# echo ""
# echo "sudo usermod -s /bin/bash zabbix ; sudo passwd zabbix"
# echo ""
# exit
#fi
SCRIPTS=/usr/lib/zabbix/alertscripts/
PROJETO=Email-Graph-ZABBIX_Python
URLGIT=https://github.com/sansaoipb/$PROJETO
if [ ! -e $PROJETO ]
then
git clone $URLGIT
fi
cd $PROJETO ; sudo rm -rf README.md ; cd /tmp/
if [ -e $SCRIPTS ]
then
PATHSCRIPTS=/usr/lib/zabbix/alertscripts
else
PATHSCRIPTS=/usr/local/share/zabbix/alertscripts
fi
cd $PATHSCRIPTS
if [ ! -e "configScrips.properties" ]
then
cd /tmp/$PROJETO ; sudo cp -R *.py configScrips.properties $PATHSCRIPTS ; cd $PATHSCRIPTS ; sudo chmod +x $PATHSCRIPTS/*.py ; cd .. ; sudo chown -R zabbix. *
else
cd /tmp/$PROJETO ; sudo cp -R *.py $PATHSCRIPTS ; cd $PATHSCRIPTS ; sudo chmod +x $PATHSCRIPTS/*.py ; cd .. ; sudo chown -R zabbix. *
fi
sudo rm -rf /tmp/$PROJETO/
echo ""
echo "Acesse"
echo ""
echo "cd $PATHSCRIPTS/"
echo ""
echo "para começar a configuração"
echo ""