-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
91 lines (62 loc) · 2.02 KB
/
installer.sh
File metadata and controls
91 lines (62 loc) · 2.02 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
declare -r DOTFILES_UTILS_URL="https://raw.githubusercontent.com/GeeksHubsAcademy/dotfilegeeks/master/utils.sh"
echo '
______ _______ _______ _ _______
( ____ \( ____ \( ____ \| \ /\( ____ \
| ( \/| ( \/| ( \/| \ / /| ( \/
| | | (__ | (__ | (_/ / | (_____
| | ____ | __) | __) | _ ( (_____ )
| | \_ )| ( | ( | ( \ \ ) |
| (___) || (____/\| (____/\| / \ \/\____) |
(_______)(_______/(_______/|_/ \/\_______)
'
download() {
local url="$1"
local output="$2"
#if command -v "curl" &> /dev/null; then
# curl -LsSo "$output" "$url" &> /dev/null
# │││└─ write output to file
# ││└─ show error messages
# │└─ don't show the progress meter
# └─ follow redirects
# return $?
#elif command -v "wget" &> /dev/null; then
wget -qO "$output" "$url"
# │└─ write output to file
# └─ don't show output
return $?
#fi
#return 1
}
download_utils() {
echo "Descargando utils ->" "$DOTFILES_UTILS_URL"
download "$DOTFILES_UTILS_URL" "/home/utils.sh" \
&& . $(dirname "$0")/utils.sh \
&& rm -rf $(dirname "$0")\
&& return 0
return 1
}
verify_os()
{
local os_name="$(get_os)"
local os_version = "$(get_os_version)"
e_header "$os_name" "-->" "$os_version"
}
main()
{
# Ensure that the following actions
# are made relative to this file's path.
echo "Archivo " $(dirname $(readlink -f $0))
if [ -x "utils.sh" ]; then
echo "localizado"
. $(dirname "$0")/utils.sh || exit 1
else
echo "no localizado"
download_utils || exit 1
fi
e_header "Iniciando Instalación" || exit 1
local os_name="$(get_os)"
verify_os \
|| exit 1
}
main "$0"