summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-01-21 15:33:32 +0100
committerHolger Levsen <holger@layer-acht.org>2017-01-21 15:33:32 +0100
commit746426557751daf9705d0ac0b0750d13e5d37a41 (patch)
treefbf4e200e7aeac65a83fbaa5637521c47ec72110
parent0384f3aa13b96bd3bd0168b19db56d4ca4b0d4bc (diff)
downloadjenkins.debian.net-746426557751daf9705d0ac0b0750d13e5d37a41.tar.xz
reproducible Debian: refactor and don't fail if ntpd ain't running
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-xupdate_jdn.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/update_jdn.sh b/update_jdn.sh
index a861f113..abbced0e 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -26,7 +26,11 @@ explain() {
echo "$HOSTNAME: $1"
}
-
+set_correct_date() {
+ # set correct date
+ sudo service ntp stop || true
+ sudo ntpdate -b de.pool.ntp.org
+}
echo "--------------------------------------------"
explain "$(date) - begin deployment update."
@@ -35,13 +39,11 @@ explain "$(date) - begin deployment update."
case $HOSTNAME in
profitbricks-build4-amd64|profitbricks-build5-amd64|profitbricks-build6-i386|profitbricks-build15-amd64|profitbricks-build16-i386)
# set correct date
- sudo service ntp stop
- sudo ntpdate -b de.pool.ntp.org
+ set_correct_date
;;
codethink-sled9*|codethink-sled11*|codethink-sled13*|codethink-sled15*)
# set correct date
- sudo service ntp stop
- sudo ntpdate -b de.pool.ntp.org
+ set_correct_date
;;
*) ;;
esac