-
Notifications
You must be signed in to change notification settings - Fork 0
/
fart.sh
97 lines (76 loc) · 2.96 KB
/
fart.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
#!/bin/bash
paru -S figlet
echo "Give them FIRE" | figlet
logfile=~/Documents/script_execution.log
function check_success() {
if [ $? -eq 0 ]; then
echo "$1 completed successfully." >> "$logfile"
else
echo "$1 failed. Check log for details." >> "$logfile"
exit 1
fi
}
function update_system() {
sudo pacman -Syu --noconfirm
}
### Jellyfin Setup ###
echo "Installing Jellyfin..."
paru -S jellyfin-git --noconfirm
sudo systemctl start jellyfin
sudo systemctl enable jellyfin
check_success "Jellyfin installation"
### Transcoding Setup for Nvidia GPU (if applicable) ###
if nvidia-smi > /dev/null 2>&1; then
echo "NVIDIA GPU detected. Setting up transcoding..."
sudo pacman -Syu jellyfin-ffmpeg nvidia-utils --noconfirm
nvidia-smi
echo "Please configure Jellyfin settings manually: Go to playback > transcoding and select 'NVIDIA' from the dropdown menu."
check_success "Transcoding setup for NVIDIA GPU"
else
echo "No NVIDIA GPU detected. Skipping transcoding setup."
fi
# Enable and start Docker
sudo pacman -S docker
sudo systemctl enable --now docker
check_success "Docker enabling and starting"
### Ollama Setup ###
echo "Installing Ollama..."
curl -fsSL https://ollama.com/install.sh | sh
sudo systemctl start ollama
sudo systemctl enable ollama
ollama pull llama3.1
check_success "Ollama installation"
### Open WebUI Install ###
echo "Installing Open WebUI..."
sudo docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
check_success "Open WebUI installation"
### Stable Diffusion Install ###
echo "Installing Stable Diffusion dependencies and tools..."
# Prerequisites for Pyenv
paru -S --needed make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git
# Install Pyenv
curl https://pyenv.run | bash
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
{
echo 'eval "$(pyenv init --path)"'
echo 'eval "$(pyenv init -zsh)"'
echo 'eval "$(pyenv virtualenv-init -zsh)"'
} >> ~/.bash_profile
source ~/.bash_profile
# Install Python 3.10
pyenv install 3.10
pyenv global 3.10
### CasaOS Setup ###
echo "Installing CasaOS prerequisites..."
update_system # Reuse the function to update and upgrade the system before installing CasaOS prerequisites
paru -S --needed curl smartmontools ntfs-3g net-tools samba apparmor \
parted cifs-utils unzip docker-compose rclone docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --noconfirm
paru -S --needed udevil-git mergerfs --noconfirm
check_success "CasaOS prerequisites installation"
# Install CasaOS using the script provided by CasaOS
curl -fsSL https://get.casaos.io | sudo bash
check_success "CasaOS installation"
echo "Script execution completed. Log file is located at $logfile."
echo "Enjoy :)" | figlet