From 4a162f6fc8d53d959dd23e1138059dd239ff5124 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 11 Jan 2008 11:57:36 +0000 Subject: Add ipa-server-install --uninstall Add a --uninstall option to ipa-server-install which tries to restore the system to the way it was before ipa-server-install was run using the state backed up through sysrestore.py. Signed-off-by: Mark McLoughlin --- ipa-server/ipaserver/ntpinstance.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ipa-server/ipaserver/ntpinstance.py') diff --git a/ipa-server/ipaserver/ntpinstance.py b/ipa-server/ipaserver/ntpinstance.py index c40b12b0..a4f1e183 100644 --- a/ipa-server/ipaserver/ntpinstance.py +++ b/ipa-server/ipaserver/ntpinstance.py @@ -70,3 +70,17 @@ class NTPInstance(service.Service): self.step("configuring ntpd to start on boot", self.__enable) self.start_creation("Configuring ntpd") + + def uninstall(self): + running = self.restore_state("running") + enabled = self.restore_state("enabled") + + if not running is None: + self.stop() + if not enabled is None and not enabled: + self.chkconfig_off() + + sysrestore.restore_file("/etc/ntp.conf") + + if not running is None and running: + self.start() -- cgit