summaryrefslogtreecommitdiffstats
path: root/util/bin
diff options
context:
space:
mode:
authortv <tv@also>2011-07-20 22:40:22 +0200
committertv <tv@also>2011-07-20 22:40:22 +0200
commit7c3d5b835514eecec6a9d20963fc7a4d1dcee221 (patch)
tree42418112cfcfa4d009f9fc2c91210416ddb177e1 /util/bin
parent12568135bd4372de24225bc0acc3108870ea2961 (diff)
util krebsdate: initial commit
Diffstat (limited to 'util/bin')
-rwxr-xr-xutil/bin/krebdate10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/bin/krebdate b/util/bin/krebdate
new file mode 100755
index 00000000..b2aa02d2
--- /dev/null
+++ b/util/bin/krebdate
@@ -0,0 +1,10 @@
+#! /bin/sh
+set -euf
+
+if test "${nosudo-false}" != true -a `id -u` != 0; then
+ echo "we're going sudo..." >&2
+ exec sudo "$0" "$@"
+ exit 23 # go to hell
+fi
+
+date --date="`ssh krebs 'date --rfc-3339=s'`"