-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-install.sh
More file actions
executable file
·57 lines (44 loc) · 1.25 KB
/
pre-install.sh
File metadata and controls
executable file
·57 lines (44 loc) · 1.25 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
#!/usr/bin/env bash
REPO_URL="https://github.com/SandwichBtw/system-setup.git"
REPO_NAME=$(basename $REPO_URL .git)
RED="\033[0;31m"
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
NC="\033[0m" # No Color
clear
print() {
echo -e "$1$2$NC"
}
print $GREEN ":: Running Pre-Install script."
sleep 1
print $YELLOW ":: Install required dependencies."
if command -v apt &> /dev/null; then
print $GREEN ":: Found apt package manager."
sudo apt update
sudo apt install -y make git pipx
elif command -v dnf &> /dev/null; then
print $GREEN ":: Found dnf package manager."
sudo dnf install -y make git pipx
elif command -v pacman &> /dev/null; then
print $GREEN ":: Found pacman package manager."
sudo pacman -S --noconfirm make git python-pipx
else
print $RED ":: Unsupported package manager. Exiting."
exit 1
fi
sleep 1
print $YELLOW ":: Install ansible using pipx"
pipx install --include-deps ansible
pipx ensurepath
sleep 1
print $YELLOW ":: Update PATH variable."
export PATH="$HOME/.local/bin:$PATH"
sleep 1
print $YELLOW ":: Clone Github repository ($REPO_URL)"
#git clone $REPO_URL
#cd $REPO_NAME
sleep 1
print $GREEN ":: Configure install parameters"
make configure
print $GREEN ":: Run ansible playbook. Installing!"
make install