#!/usr/bin/env bash

# Get install path
DEST="${1:?'Where to install?'}"

# Get absolute path of this directory (especially when symlinked)
SRC="$(realpath "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"

# Load accompanying bash library
source "$(dirname "$(dirname "$SRC")")/lib/lib.bash"

say "Installing $(basename "$SRC") services"
tl-install-svc \
  dhcpcd nftables \
  sshd lighttpd

say "Installing $(basename "$SRC") files"
tl-install "nftables.conf" 0 0 640 "etc/nftables.conf"
tl-install "lighttpd.conf" 0 0 640 "etc/lighttpd/lighttpd.conf"
tl-install "sshd_config"   0 0 640 "etc/ssh/sshd_config"
