#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

if [ -f /usr/libexec/helper-scripts/pre.bsh ]; then
   source /usr/libexec/helper-scripts/pre.bsh
fi

set -e

if [ "$1" = "purge" ]; then
   ## delete sclockadj only when package is removed using apt-get with purge option
   ## otherwise during `release-upgrade` postrm script might run,
   ## delete sclockadj while sdwdate is still running
   rm --force /usr/libexec/sdwdate/sclockadj

   rm --force "/var/log/sdwdate.log"
   rm -r --force "/var/cache/sdwdate"
fi

#DEBHELPER#
