This repository has been archived by the owner on Oct 6, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·164 lines (143 loc) · 4.12 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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/bash
# installer for Cryptex
# created by : Soulsender and C0SM0
# DO NOT FUCK WITH THIS SCRIPT
# color variables
red="\e[0;91m"
green="\e[0;92m"
blue="\e[0;94m"
bold="\e[1m"
reset="\e[0m"
function staging {
# continue prompt
while true
do
read -r -p "This will copy Cryptex to your home directory. If you already had Cryptex installed, this will reinstall it. Would you like to continue? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo -e "${green}Continuing...${reset}"
sleep 2
install=true
break
;;
[nN][oO]|[nN])
echo -e "${red}Operation canceled.${reset}"
break
exit 0
;;
*)
echo -e "${red}Invalid input...${reset}"
;;
esac
done
# staging
echo -e "${blue}[*] Staging process...${reset}"
rm -rf ~/.Cryptex
cd ..
cp -r Cryptex ~/.Cryptex
echo -e "${green}[+] Complete${reset}"
}
function alias_workflow {
# set up alias workflow
echo -e "${blue}[*] Setting up alias...${reset}"
# check if it already exists in bashrc
if ! cat ~/.bashrc | grep "CRYPTEX_PATH" > /dev/null; then
# Do it in one command instead of repeating yourself.
echo "
export CRYPTEX_PATH=\"~/.Cryptex\"
alias cryptex=\"python3 ~/.Cryptex/main.py\"
" >> ~/.bashrc
fi
#check if it already exists in zshrc
if ! cat ~/.zshrc | grep "CRYPTEX_PATH" > /dev/null; then
# Do it in one command instead of repeating yourself.
echo "
export CRYPTEX_PATH=\"~/.Cryptex\"
alias cryptex=\"python3 ~/.Cryptex/main.py\"
" >> ~/.zshrc
fi
echo -e "${green}[+] Completed${reset}"
# call staging
staging
# clean up
echo -e "${green}[+] Installation Successful"
echo -e "[+] Please Restart your terminal"
echo -e "[+] type 'cryptex' launch Cryptex${reset}"
bash
}
# check if run with sudo
if [ "$EUID" -ne 0 ]; then
continue
else
echo -e "${red}Do not run as root. The script will prompt you for root access.${reset}"
exit 0
fi
# arguments
while [ -n "$1" ]
do
case "$1" in
--help)
echo "
SUPPORTED DISTROS:
- Debian
- Parrot
- Ubuntu
- Kali
- Mint
- Arch
- Void
Please see the Cryptex README for more infomation:
https://github.com/CryptexProject/Cryptex
"
exit 0
;;
--unsupported-distro)
# call alias workflow function
alias_workflow
exit 0
;;
esac
shift
done
# check for valid distro (Parrot, Ubuntu, Void, Debian, Arch)
distro=`sudo cat /etc/issue | awk '{print $1;}'`
if [[ "$distro" == "Debian" ]] || [[ "$distro" == "Parrot" ]] || [[ "$distro" == "Ubuntu" ]] || [[ "$distro" == "Linux" ]] || [[ "$distro" == "Kali" ]]; then
# installing tools for debian
echo -e "${red}Debian${reset} system detected."
echo -e "${blue}[*] Installing tools...${reset}"
sudo apt update
sudo apt-get install -y python3 python3-pip python-dev
pip install qrcode
pip install Cryptography
pip install googletrans==3.1.0a0
pip install colorama
pip install pillow
pip install numpy
echo -e "${green}[+] Completed${reset}"
elif [[ "$distro" == "Void" ]]; then
# installing tools for void
echo -e "${green}Void${reset} system detected."
echo -e "${blue}[*] Installing tools...${reset}"
sudo xbps-install -S python3
pip install qrcode
pip install Cryptography
pip install googletrans==3.1.0a0
pip install colorama
echo -e "${green}[+] Completed${reset}"
elif [[ "$distro" = "Arch" ]]; then
# installing tools for arch
echo -e "${blue}Arch${reset} system detected."
echo -e "${blue}[*] Installing tools...${reset}"
sudo pacman -Syu
sudo pacman -S python python-pip
python3 -m pip install qrcode
python3 -m pip install Cryptography
python3 -m pip install googletrans==3.1.0a0
python3 -m pip install colorama
echo -e "${green}[+] Completed${reset}"
else
echo -e "${red}[!] Unknown distro, please see documentation for unknown distros.${reset}"
exit 0
fi
# call alias workflow
alias_workflow