-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
66 lines (49 loc) · 1.35 KB
/
install.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
66
#!/bin/bash
echo "Every jump begins with a small step..."
sleep 3s
# loading Bar
show_progress() {
local progress_char="/-\|"
local i=0
while true; do
i=$(( (i+1) % 4 ))
printf "\r${progress_char:$i:1} $1 "
sleep 0.1
done
}
# execute script with the loading bar
execute_script_with_progress() {
local script_path=$1
local step_name=$2
echo "$step_name..."
# execution of the screen on backgroudn
"$script_path" &
# Save ID
local script_pid=$!
# progress bar in backgroudn
show_progress "$step_name" &
# waiting the ending of execution
wait $script_pid
# stopping the progress bar with SIGTERM
kill $! &>/dev/null
# wipe the progress bar
printf "\r$step_name... Done. \n"
# check the error
if [ $? -ne 0 ]; then
echo "$step_name failed."
exit 1
fi
}
chmod o-rwx ./Yggdrasil -R
chmod g-rwx ./Yggdrasil -R
# Docker-install
chmod 700 ./install/docker-install.sh
execute_script_with_progress ./install/docker-install.sh "docker-install"
# Gvisor-install
chmod 700 ./install/gvisor-install.sh
execute_script_with_progress ./install/gvisor-install.sh "gvisor-install"
# giving authorization yggdrasil.sh
chmod 100 ./Yggdrasil.sh
# Succes
echo "Success..."
echo "Good luck for your work ! you have just made a first step !"