#!/bin/sh -x warn() { echo "$0: $1" >&2 } err() { warn "$1" exit 1 } set -e if [ $(id -u) -ne 0 ]; then err "This script must be run as root" fi if [ $(uname) != "FreeBSD" ]; then err "This script only runs on FreeBSD" fi pkg bootstrap -y pkg install -y bash bash-completion git neovim sudo zfs create zroot/home/markj pw useradd -m -n markj -G wheel -s /usr/local/bin/bash cat <<__EOF__ >> /usr/local/etc/sudoers %wheel ALL=(ALL:ALL) ALL Defaults timestamp_timeout=120 __EOF__ su - markj <<__EOF__ git clone https://github.com/markjdb/dotfiles mkdir bin dl src tmp dotfiles/install __EOF__ mkdir -p /usr/local/etc/pkg/repos cat <<__EOF__ > /usr/local/etc/pkg/repos/FreeBSD-base.conf FreeBSD-base: { url: "http://pkg-main/FreeBSD-base/\${ABI}/latest", enabled: yes } __EOF__ pkg -o ABI=FreeBSD:15:$(uname -p) update -f passwd markj