You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/06/25 10:43:47 UTC
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5160: Fix configuration of ntp server list in systemVMs
DaanHoogland commented on a change in pull request #5160:
URL: https://github.com/apache/cloudstack/pull/5160#discussion_r658670099
##########
File path: systemvm/debian/opt/cloud/bin/setup/common.sh
##########
@@ -567,14 +567,12 @@ setup_ntp() {
if [ -f $NTP_CONF_FILE ]
then
IFS=',' read -a server_list <<< "$NTP_SERVER_LIST"
+ sed -i "/^server /d" $NTP_CONF_FILE
for (( iterator=${#server_list[@]}-1 ; iterator>=0 ; iterator-- ))
do
server=$(echo ${server_list[iterator]} | tr -d '\r')
PATTERN="server $server"
- if grep -q "^$PATTERN$" $NTP_CONF_FILE ; then
- sed -i "/^$PATTERN$/d" $NTP_CONF_FILE
- fi
- sed -i "0,/^server/s//$PATTERN\nserver/" $NTP_CONF_FILE
+ sed -i "0,/^#server/s//$PATTERN\n#server/" $NTP_CONF_FILE
Review comment:
```suggestion
sed -i "0,/^#server/s//#server\n$PATTERN\n/" $NTP_CONF_FILE
```
no biggy, but this seems a little neater comment pertaining to the line below and not above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org