#!/bin/sh

for site in "${CADDY_ROOT:-/opt/caddy}"/src/*; do
  cd "${site}" || continue
  echo "== CADDY: ${site} =="
  sudo -u caddy git pull --ff
  if test -x build.sh; then
          sudo -u caddy ./build.sh
  fi
  echo "== DONE =="
done

s caddy restart
