#!/bin/bash

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

set -e

if [ ! "$(id -u)" = "0" ]; then
    printf '%s\n' "$0: ERROR: Must be run as root (sudo)!"
    exit 1
fi

## If this script is run as root.
rm --force -- /run/anondate/tor_certificate_lifetime_set
## If this script is run under account 'sdwdate'.
rm --force -- /run/sdwdate/tor_certificate_lifetime_set

rm --force -- /run/sdwdate/first_success
rm --force -- /run/sdwdate/clock_jump_do_once

leaprun sdwdate-clock-jump-do-once-file-create

leaprun restart-sdwdate

true "$0: OK"
