-
Notifications
You must be signed in to change notification settings - Fork 3
/
AutoRUN.sh
61 lines (48 loc) · 1.4 KB
/
AutoRUN.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
#!/bin/sh
red=$'\e[1;31m'
grn=$'\e[1;32m'
yel=$'\e[1;33m'
mag=$'\e[1;35m'
cyn=$'\e[1;36m'
nc=$'\e[0m'
function print_ending_message {
echo ---------------
echo ${grn}A NEW SERVER HAS STARTED !!! ${nc}
echo ---------------
echo
now=$(date)
echo ===== ${cyn}THANK YOU${nc} for using my Scripts - ${yel}HENRY LE${grn} ${grn}"(06/2020)"${nc} =====
echo
finishTime=$(date)
printf " Local Time :: %s\n" "${mag}$finishTime${nc}"
echo
echo " Script Total Time :: ${mag}$SECONDS${nc} second(s)"
echo
echo " When you're ${yel}DONE${yel}, ${yel}CLOSE THIS WINDOW${nc} to ${yel}SHUT DOWN${nc} server."
echo
echo =============================
echo ${cyn}
echo
}
echo
echo +++ Brought to you by: ${cyn}HENRY LE${nc} +++
echo -e +++ Version: ${mag}1${nc}, Date: ${mag}Jul, 2020${nc} +++
echo =============================
startTime=$(date)
SECONDS=0
echo
printf "Local Time: %s\n" "${mag}$startTime${nc}"
echo ---------------
echo
echo
echo ${red}Deactivate${nc} any ${yel}existing Environment${nc}. Please wait...
conda deactivate
echo ---------------
echo ${cyn}Activate new Python Environment${nc}. Please wait...
echo ---------------
conda activate tfg
echo ${yel}Done Activating Environment${nc}.
echo ---------------
echo ${red}Starting up ${cyn}Server${nc} and ${cyn}Browser${nc}... Please wait...
python application.py & sleep 4 & python -mwebbrowser http://127.0.0.1:5000/ &&
print_ending_message