Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added suspend-pre, suspend-post and clock-fix handler scripts
- Loading branch information
Patrick Schleizer
committed
Mar 15, 2016
1 parent
0e3de19
commit 5dda984
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ ! "$(id -u)" = "0" ]; then | ||
echo "ERROR: Must run as root!" >&2 | ||
exit 2 | ||
fi | ||
|
||
if [ -d "/usr/lib/qubes" ]; then | ||
randomized_unix_time="$(timeout --kill-after="5" "5" /usr/lib/qubes/qrexec-client-vm dom0 qubes.GetRandomizedTime)" | ||
else | ||
echo "ERROR: Not implemented in Non-Qubes-Whonix. See: https://www.whonix.org/wiki/Troubleshooting#Clock_Fix" >&2 | ||
exit 3 | ||
fi | ||
|
||
date --set "@$randomized_unix_time" >/dev/null | ||
|
||
service sdwdate restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ ! "$(id -u)" = "0" ]; then | ||
echo "ERROR: Must run as root!" >&2 | ||
exit 2 | ||
fi | ||
|
||
## Do not interfere with the clock if the service was stopped. | ||
if test -f /var/run/sdwdate/was_running.status ; then | ||
rm -f /var/run/sdwdate/was_running.status | ||
/usr/lib/sdwdate/clock-fix || true | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ ! "$(id -u)" = "0" ]; then | ||
echo "ERROR: Must run as root!" >&2 | ||
exit 2 | ||
fi | ||
|
||
if service sdwdate status >/dev/null ; then | ||
touch /var/run/sdwdate/was_running.status | ||
service sdwdate stop | ||
fi |