-
Notifications
You must be signed in to change notification settings - Fork 6
/
Config_DB.sh
54 lines (53 loc) · 2.01 KB
/
Config_DB.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
#funMenu=(dialog --separate-output --checklist "Selecciona la opcion deseada para BD IoT Hotspot:" 0 0 0)
funMenu=(dialog --clear --backtitle "--------------------" --title "Menu principal" --separate-output --checklist "Selecciona la opcion deseada para BD IoT:" 0 0 0)
opciones=(1 "Crear BD IoT-Hotspot" off 2 "Poblar BD" off 3 "Restablecimiento por Default" off)
selecciones=$("${funMenu[@]}" "${opciones[@]}" 2>&1 >/dev/tty)
clear
OK="OK"
for seleccion in $selecciones
do
case $seleccion in
1)
#echo "php artisan migrate"
FechaInicio=$(date)
Usuario=$(who)
Variable=$(php artisan migrate | grep completed: | awk '{print $2}')
$Variable
FechaFin=$(date)
echo -e "(Incio: $FechaInicio)" >> IOT-Hotspot.log
echo -e "(Usuario:$Usuario)" >> IOT-Hotspot.log
echo -e "(Variable:php artisan migrate)" >> IOT-Hotspot.log
echo -e "(Fin:$FechaFin)" >> IOT-Hotspot.log
echo -e "(Status:$OK)" >> IOT-Hotspot.log
echo -e "#################################################" >> IOT-Hotspot.log
;;
2)
#echo "php artisan db:seed"
FechaInicio=$(date)
Usuario=$(who)
Variable=$(php artisan db:seed | grep completed: | awk '{print $2}')
$Variable
FechaFin=$(date)
echo -e "(Incio: $FechaInicio)" >> IOT-Hotspot.log
echo -e "(Usuario:$Usuario)" >> IOT-Hotspot.log
echo -e "(Variable:php artisan db:seed)" >> IOT-Hotspot.log
echo -e "(Fin:$FechaFin)" >> IOT-Hotspot.log
echo -e "(Status:$OK)" >> IOT-Hotspot.log
echo -e "#################################################" >> IOT-Hotspot.log
;;
3)
#echo "php artisan migrate:fresh --seed"
FechaInicio=$(date)
Usuario=$(who)
Variable=$(php artisan migrate:fresh --seed | grep completed: | awk '{print $2}')
$Variable
FechaFin=$(date)
echo -e "(Incio: $FechaInicio)" >> IOT-Hotspot.log
echo -e "(Usuario:$Usuario)" >> IOT-Hotspot.log
echo -e "(Variable:php artisan migrate:fresh --seed)" >> IOT-Hotspot.log
echo -e "(Fin:$FechaFin)" >> IOT-Hotspot.log
echo -e "(Status:$OK)" >> IOT-Hotspot.log
echo -e "#################################################" >> IOT-Hotspot.log
;;
esac
done