From e371e98650cfda4c30865306d0f10949794911c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 18 Jan 2021 18:02:35 +0100 Subject: [PATCH] remove course mapping when deleting card file --- cards/update_card.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cards/update_card.sh b/cards/update_card.sh index 97dedf3..bf8bce1 100755 --- a/cards/update_card.sh +++ b/cards/update_card.sh @@ -131,6 +131,15 @@ case "$action" in delete) rm "$cardfile" RELEASE_SLOCK "$cardfile" + if LOCK "$attfile"; then + grep -F " ${card}" "$attfile" |while read course junk; do + touch "$_DATA/ical/${course}" + done + sed -i -E "/^.+ ${card}\$/d" "$attfile" + RELEASE "$attfile" + else + SET_COOKIE 0 message="COULD NOT UPDATE COURSE MAPPINGS" + fi REDIRECT "/cards/?o=${order}&f=${filter}" ;; esac -- 2.39.2