Newer
Older
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import utils
def setup(interactive=True):
dir_path = utils.get_dir(__file__)
servers = ''
if utils.get_conf('NTP_SERVER'):
for server in utils.get_conf('NTP_SERVER').split(','):
if server.strip():
servers += 'pool %s\n' % server.strip()
servers = 'pool ntp.ubuntu.com\n'
'DEBIAN_FRONTEND=noninteractive apt-get install -y ntp',
'echo "Replacing /etc/ntp.conf"',
dict(line='write', template='%s/ntp.conf' % dir_path, target='/etc/ntp.conf', params=(
'systemctl restart ntp.service',