-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-machine-freebsd
executable file
·65 lines (57 loc) · 1.12 KB
/
build-machine-freebsd
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/sh
# FreeBSD
# curl -sSL https://raw.githubusercontent.com/hut8/build-machine/master/build-machine-freebsd | sh
set -eu
repo_url='https://raw.githubusercontent.com/hut8/build-machine/master'
if ! [ "$(id -u)" = 0 ]; then
echo 'this script must be run as root'
exit 1
fi
user_exists() { getent passwd "$1" > /dev/null; }
pkg update
pkg upgrade --yes
pkg install --yes \
autoconf \
automake \
bash \
cmake \
curl \
emacs-nox \
g++ \
gcc \
git \
gnupg \
go \
htop \
jq \
libyaml \
ncdu \
pv \
python3 \
recode \
ripgrep \
rmlint \
rsync \
tmux \
tree \
wget \
zsh
hash rclone 2>/dev/null || {
curl https://rclone.org/install.sh | bash
}
# Create my user
if ! user_exists "liam";
then
echo 'creating user'
useradd \
--comment 'Liam' \
--user-group \
--shell /usr/bin/zsh \
--create-home \
liam
else
chsh --shell /usr/bin/zsh liam # idempotent
fi
curl -sSL "$repo_url/sudoers" > /etc/sudoers.d/liam
curl -sSL "$repo_url/build-account" |
sudo --set-home -u liam /usr/bin/zsh