summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/bindinstance.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2008-01-11 11:57:36 +0000
committerMark McLoughlin <markmc@redhat.com>2008-01-11 11:57:36 +0000
commit4a162f6fc8d53d959dd23e1138059dd239ff5124 (patch)
tree650d2c3394b728aa694e6da9ea8ded29427ab99c /ipa-server/ipaserver/bindinstance.py
parentc7f3c746ccfd74480064dbe73fbc754548c30927 (diff)
downloadfreeipa.git-4a162f6fc8d53d959dd23e1138059dd239ff5124.tar.gz
freeipa.git-4a162f6fc8d53d959dd23e1138059dd239ff5124.tar.xz
freeipa.git-4a162f6fc8d53d959dd23e1138059dd239ff5124.zip
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 <markmc@redhat.com>
Diffstat (limited to 'ipa-server/ipaserver/bindinstance.py')
-rw-r--r--ipa-server/ipaserver/bindinstance.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/bindinstance.py b/ipa-server/ipaserver/bindinstance.py
index 770663c6..9e26925a 100644
--- a/ipa-server/ipaserver/bindinstance.py
+++ b/ipa-server/ipaserver/bindinstance.py
@@ -110,3 +110,18 @@ class BindInstance(service.Service):
resolve_fd.write(resolve_txt)
resolve_fd.close()
+ def uninstall(self):
+ running = self.restore_state("running")
+ domain = self.restore_state("domain")
+
+ if not running is None:
+ self.stop()
+
+ if not domain is None:
+ sysrestore.restore_file(os.path.join ("/var/named/", self.domain + ".zone.db"))
+
+ sysrestore.restore_file('/etc/named.conf')
+ sysrestore.restore_file('/etc/resolve.conf')
+
+ if not running is None and running:
+ self.start()