-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.sh
39 lines (33 loc) · 973 Bytes
/
check.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
#!/usr/bin/env bash
set -euo pipefail
if [[ "$HOSTNAME" == "archiso" ]]; then
echo "Do NOT run on the installation medium, install arch first!"
echo "https://wiki.archlinux.org/index.php/Installation_guide"
exit 1
fi
if [[ ! -x "$(command -v pacman)" ]] && [[ -z ${USER_ONLY+x} ]]; then
echo "Missing pacman"
echo "These dotfiles only support Arch Linux"
exit 2
fi
if [[ ! -x "$(command -v git)" ]]; then
echo "Missing git (how did you even get this repo?)"
echo "pacman -S git"
exit 2
fi
if [[ ! -x "$(command -v ssh)" ]]; then
echo "Missing ssh (required for git)"
echo "pacman -S openssh"
exit 2
fi
if [[ ! -x "$(command -v python)" ]] && [[ ! -x "$(command -v python3)" ]]; then
echo "Missing python (required for dotbot)"
echo "pacman -S python"
exit 2
fi
if [[ "$EUID" -eq 0 ]] && [[ -z ${USER_ONLY+x} ]]; then
echo "Do NOT run as root, create your own user!"
echo "useradd -m -U USERNAME"
echo "passwd USERNAME"
exit 3
fi