#!/bin/bash BASEDIR="$1" cd "${BASEDIR}" LOCKFILE="${BASEDIR}/crawl.lock" if [[ -f "${LOCKFILE}" ]]; then echo "Lockfile is there, exiting" exit fi touch "${LOCKFILE}" rm -f "${BASEDIR}/gus.log" "${BASEDIR}/infra/filter_seed_request.sh" "${BASEDIR}" /home/gus/.local/bin/poetry run crawl /home/gus/.local/bin/poetry run build_index systemctl --user restart gus rm "${LOCKFILE}"