-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
27 lines (22 loc) · 984 Bytes
/
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
#!/bin/bash
# Create the directory
mkdir -p ~/.usr_scripts/cryptography/
echo "Directory has been created at ~/.usr_scripts/cryptography/"
# Download the code
curl -o ~/.usr_scripts/cryptography/encrypt_file.py https://raw.githubusercontent.com/AthomsG/cript/main/crypt.py
echo "Code has been pulled"
# Add the alias to the appropriate shell configuration file
if [[ $SHELL == *"bash"* ]]; then
if ! grep -q "alias crypt=" ~/.bashrc; then
echo "alias crypt='python3 ~/.usr_scripts/cryptography/encrypt_file.py'" >> ~/.bashrc
fi
source ~/.bashrc
elif [[ $SHELL == *"zsh"* ]]; then
if ! grep -q "alias crypt=" ~/.zshrc; then
echo "alias crypt='python3 ~/.usr_scripts/cryptography/encrypt_file.py'" >> ~/.zshrc
fi
source ~/.zshrc
fi
echo "Installation complete! Reset terminal and run 'crypt --help' for usage information, or check out the github repository: https://github.com/AthomsG/crypt/tree/main"
echo "Press any key to exit"
read -n 1