Skip to content

Commit

Permalink
stop any active timers if the coffin is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushnix committed Oct 8, 2021
1 parent 0f18d94 commit 6c445d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions coffin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ COFFIN_TIME=""
COFFIN_STATUS=""

coffin_close() {
local timer_status
COFFIN_STATUS="close"

local pwd
Expand Down Expand Up @@ -54,6 +55,11 @@ coffin_close() {
! -path "./${EXTENSIONS##*/}/*" -delete > /dev/null 2>&1 \
|| coffin_bail "Unable to finish creating a coffin. Trying to restore any changes."

timer_status="$(systemctl --user is-active "$PROGRAM-coffin".timer 2> /dev/null)"
if [[ "$timer_status" == "active" ]]; then
systemctl --user stop "$PROGRAM-coffin".timer > /dev/null 2>&1
fi

cd "$pwd" > /dev/null 2>&1 || cd "$HOME" || false

printf '%s\n' "[#] Password Store data is now hidden inside a GPG coffin"
Expand Down

0 comments on commit 6c445d8

Please sign in to comment.