aboutsummaryrefslogtreecommitdiff
path: root/scripts/os/freebsd/40-pkg
blob: 46adc661abda892b39ae1d15e2f509ac9958a062 (plain) (blame)
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
#!/bin/sh

case $BOXCONF_HOSTCLASS in
  pkg_repository)
    return # Do nothing.
    ;;
  freebsd_hypervisor|roadwarrior_laptop)
    ;; # Keep default FreeBSD pkg repository.
  *)
    # Configure on-prem pkg repository.
    install_directory -m 0755 \
      /usr/local/etc/pkg \
      /usr/local/etc/pkg/repos

    install_file -m 0644 \
      /usr/local/etc/ssl/repo.crt \
      /usr/local/etc/pkg/repos/FreeBSD.conf

    install_template -m 0644 /usr/local/etc/pkg/repos/onprem.conf
    ;;
esac

# Update packages.
pkg update -f

# Install default packages.
if [ -n "${install_packages:-}" ]; then
  pkg install -y $install_packages
fi