-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-install.sh
executable file
·65 lines (48 loc) · 1.79 KB
/
web-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
#!/bin/bash
set -e # Exit immediately on error
show_help() {
echo "Usage: $0 [options]"
echo "Options:"
echo " --help Display this help message"
echo " --noconfirm Skip confirmation prompts"
echo " --de Install desktop environment"
echo " --[stage] Select a specific installation stage (e.g., --05)"
echo " --clean Clean up installation when done"
}
# Check if "--help" option is provided
if [[ "$*" == *--help* || "$*" == *-h* ]]; then
show_help
exit 0
fi
# ------------------------------------------------------------------------------
source <(curl -sSL "https://raw.githubusercontent.com/Nachtalb/os-setup/master/utils.sh?token=$(date +%s)")
# ------------------------------------------------------------------------------
check_arch_linux
# ------------------------------------------------------------------------------
noconfirm=""
if [[ " $* " == *" --noconfirm "* ]]; then
noconfirm="--noconfirm"
fi
print_message $GREEN $INVERT "Starting web-install script."
print_message $GREEN " Making sure we can use pacman..."
pacman-key --init
pacman-key --populate
sudo pacman -Sy archlinux-keyring $noconfirm --needed
print_message $GREEN " Downloading installer..."
sudo pacman -Sy git --needed $noconfirm
target_dir="/tmp/os-setup"
if [ -d "${target_dir}" ]; then
print_message $BLUE " OS-Setup was already downloaded to '${target_dir}'"
cd $target_dir
git pull -r
else
git clone https://github.com/Nachtalb/os-setup "${target_dir}"
fi
cd /tmp/os-setup
# ------------------------------------------------------------------------------
print_message $GREEN "Running installer..."
./install.sh "$@"
if [[ " $* " == *" --clean "* ]]; then
rm -rf /tmp/os-setup
fi
print_message $GREEN $INVERT "Installation completed successfully."