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