-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathoptimizador
30 lines (30 loc) · 1.38 KB
/
optimizador
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
#!/bin/sh
#Autor: Henry Chumo
#Alias : ChumoGH
unset opti
opti=$(cat /bin/ejecutar/val)
if [ "$opti" = "0" ]; then
echo "activado" > /bin/ejecutar/val1
sed -i "s;0;1;g" /bin/ejecutar/val
echo 'source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/gnula.sh)' > /bin/ejecutar/automatizar.sh
echo 'source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/killram.sh)' > /bin/ejecutar/gnula.sh
#echo 'source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/autobackup.sh)' >> /bin/ejecutar/gnula.sh
chmod +x /bin/ejecutar/automatizar.sh
cp /etc/crontab /bin/ejecutar/crontab.original
sed -i "s;00 00 * * * root bash /bin/ejecutar/automatizar.sh;#;g" /etc/crontab
sed '/automatizar.sh/ d' /etc/crontab > /bin/ejecutar/crontab
cat /bin/ejecutar/crontab > /etc/crontab
sed '/gnula.sh/ d' /etc/crontab > /bin/ejecutar/crontab
cat /bin/ejecutar/crontab > /etc/crontab
echo -e "Activando autolimpieza del Servidor"
echo -e "Todos los días a las 3AM se limpiará el Servidor automáticamente"
echo "00 03 * * * root bash /bin/ejecutar/automatizar.sh" >> /etc/crontab
#echo "00 12 * * * root bash /bin/ejecutar/automatizar.sh" >> /etc/crontab
echo "00 * * * * root bash /bin/ejecutar/gnula.sh" >> /etc/crontab
cat /etc/crontab
echo -e "Finalizando activacion"
_opti="\033[1;31m${txt[11]}"
else
unset _opti
_opti="\033[1;32m${txt[10]}"
fi