forked from raspberryenvoie/odysseyn1x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon
executable file
·118 lines (107 loc) · 4.01 KB
/
common
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Set colors variables
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
BLUE="$(tput setaf 6)"
YELLOW="$(tput setaf 3)"
PURPLE="$(tput setaf 5)"
NORMAL="$(tput sgr0)"
blue_echo() {
echo "${BLUE}${1}${NORMAL}"
}
done_echo() {
echo "${GREEN}${1}${NORMAL}"
}
failed_echo() {
echo "${RED}${1}${NORMAL}"
enter_to_quit
exit 1
}
prompt() {
printf '%s' "$1"
read -r "$2"
}
enter_to_quit() {
kill "$IPROXY" "$CHECKRA1N" > /dev/null 2>&1
printf 'Press enter to quit'
read -r null
}
center_text() {
if [ "$is_colored" = true ]; then
length="$((${#1} + 11))" # Add 11 to fix colored text (color codes are 11 characters long)
else
length="${#1}"
fi
printf "%*s\n" "$((($(tput cols) + length) / 2))" "$1"
}
android_logo() {
is_colored=true
center_text "${GREEN} # # ${NORMAL}"
center_text "${GREEN} ########### ${NORMAL}"
center_text "${GREEN} ### ####### ### ${NORMAL}"
center_text "${GREEN} ################### ${NORMAL}"
echo ''
center_text "${GREEN}#### ################### ####${NORMAL}"
center_text "${GREEN}#### ################### ####${NORMAL}"
center_text "${GREEN}#### ################### ####${NORMAL}"
center_text "${GREEN}#### ################### ####${NORMAL}"
center_text "${GREEN}#### ################### ####${NORMAL}"
center_text "${GREEN} ################### ${NORMAL}"
center_text "${GREEN} ################### ${NORMAL}"
center_text "${GREEN} #### #### ${NORMAL}"
center_text "${GREEN} #### #### ${NORMAL}"
center_text "${GREEN} #### #### ${NORMAL}"
echo ''
}
linux_logo() {
is_colored=true
center_text "${YELLOW} @@@@@@@@@@ ${NORMAL}"
center_text "${YELLOW} %@@@@@@@@@@@ ${NORMAL}"
center_text "${YELLOW} @ @ @ .@ @@@ ${NORMAL}"
center_text "${YELLOW} /@,,,,,,*@@@ ${NORMAL}"
center_text "${YELLOW} @%.*.*..*@@@@ ${NORMAL}"
center_text "${YELLOW} @@ @@@@ ${NORMAL}"
center_text "${YELLOW} @@@ @@@@@ ${NORMAL}"
center_text "${YELLOW} ,@@@ *@@@@@ ${NORMAL}"
center_text "${YELLOW} @@@@ ,@@@@@ ${NORMAL}"
center_text "${YELLOW} @@@@ @@@@@@ ${NORMAL}"
center_text "${YELLOW} *,,*@. ,,@@@@** ${NORMAL}"
center_text "${YELLOW} *,,,,,,,*@@ *,,,,,,,, ${NORMAL}"
center_text "${YELLOW} ,,,,,,,,,,/ ,,,,,,,,..*${NORMAL}"
center_text "${YELLOW},....,,,,,,,,@@, (@@@,,,,...../ ${NORMAL}"
center_text "${YELLOW} *,....* *..... ${NORMAL}"
echo ''
}
odysseyn1x_logo() {
clear
# Vertically center text
filling_lines="$((($(tput lines) - 5) / 2))" # Calculate number of filling lines
i=1
while [ "$i" -le "$filling_lines" ]; do # If $i is less or equal to filling_lines
echo
i="$(( i + 1 ))"
done
is_colored=false
center_text ' ___ __| |_ _ ___ ___ ___ _ _ _ __ / |_ __'
center_text ' / _ \ / _` | | | / __/ __|/ _ \ | | | `_ \| \ \/ /'
center_text '| (_) | (_| | |_| \__ \__ \ __/ |_| | | | | |> < '
center_text ' \___/ \__,_|\__, |___/___/\___|\__, |_| |_|_/_/\_\'
center_text ' |___/ |___/ '
}
odysseyra1n_logo() {
is_colored=true
center_text "${PURPLE} ___ __| |_ _ ___ ___ ___ _ _ _ __ __ _/ |_ __ ${NORMAL}"
center_text "${PURPLE} / _ \ / _\` | | | / __/ __|/ _ \ | | | '__/ _\` | | '_ \ ${NORMAL}"
center_text "${PURPLE}| (_) | (_| | |_| \__ \__ \ __/ |_| | | | (_| | | | | |${NORMAL}"
center_text "${PURPLE} \___/ \__,_|\__, |___/___/\___|\__, |_| \__,_|_|_| |_|${NORMAL}"
center_text "${PURPLE} |___/ |___/ ${NORMAL}"
echo ''
}
ssh_logo() {
is_colored=false
center_text ' ____ ____ _ _'
center_text '/ ___/ ___|| | | |'
center_text '\___ \___ \| |_| |'
center_text ' ___) |__) | _ |'
center_text '|____/____/|_| |_|'
echo ''
}