-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·37 lines (31 loc) · 1.2 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
#!/usr/bin/bash
# Install script for List Download
# Verify that the PWD is the listDownload root directory.
CURR_DIR=${PWD##*/}
REQ_CURR_DIR="listDownload"
if [[ $CURR_DIR != $REQ_CURR_DIR ]]; then
echo "ERROR: Wrong path, this script must be executed inside listDownload repository" 1>&2
exit
fi
APT_PATH=$(which apt)
PACMAN_PATH=$(which pacman)
if [[ $APT_PATH != "" ]]; then # verify the presence of the apt manager
sudo apt update -y
sudo apt install git xterm python3 -y
sudo apt autoremove -y
elif [[ $PACMAN_PATH != "" ]]; then # verify the presence of the pacman manager
sudo pacman -Syy
sudo pacman -S git xterm python3 -y
else
echo "This Install script wasn't think for your Pack Manager (Apt or Pacman), please install by yourself the following dependances:"
echo "install: git xterm python3"
echo "Thanks for the cooperation =}"
fi
sudo chmod +x listDownload.py
REPO_DIR=$(pwd)
mkdir -p ~/.local/bin
cd ~/.local/bin
ln -s $REPO_DIR/listDownload.py
echo "If 'listDownload.py' isn't reach from the PATH, PLEASE reboot the system"
# Export the current path on Mark this setup task as done.
# printf '\n# List download Path add\nPATH="$PATH:'$REPO_DIR'"\n' >> ~/.profile