Skip to content

Commit

Permalink
update installer.sh ensure ntpd date/time is set before install
Browse files Browse the repository at this point in the history
otherwise curl installer.sh based install time calculations will be skewed and incorrect as the timezone changes half way into the install routine
  • Loading branch information
centminmod committed Jun 3, 2016
1 parent bac2341 commit 33b7254
Show file tree
Hide file tree
Showing 14 changed files with 252 additions and 0 deletions.
18 changes: 18 additions & 0 deletions installer-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer-latest-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer-minimal-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer-minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer-ngxpagespeed-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer-ngxpagespeed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer55-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer55.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer56-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer56.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer7-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down
18 changes: 18 additions & 0 deletions installer7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ if [ "$CENTOSVER" == 'Enterprise' ]; then
OLS='y'
fi

if [ -f /proc/user_beancounters ]; then
cecho "OpenVZ system detected, NTP not installed" $boldgreen
else
if [ ! -f /usr/sbin/ntpd ]; then
echo "*************************************************"
cecho "* Installing NTP (and syncing time)" $boldgreen
echo "*************************************************"
echo "The date/time before was:"
date
echo
yum -y install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
echo "The date/time is now:"
date
fi
fi

fileperm_fixes() {
if [ -f /usr/lib/udev/rules.d/60-net.rules ]; then
if [[ "$(lsattr /usr/lib/udev/rules.d/60-net.rules | cut -c5)" = 'i' ]]; then
Expand Down

0 comments on commit 33b7254

Please sign in to comment.