From 746426557751daf9705d0ac0b0750d13e5d37a41 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 21 Jan 2017 15:33:32 +0100 Subject: reproducible Debian: refactor and don't fail if ntpd ain't running Signed-off-by: Holger Levsen --- update_jdn.sh | 12 +++++++----- 1 file 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 -- cgit v1.2.3-70-g09d2