From 45e310ecc45bbf0c4656b3f46ad4aa659af928de Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Wed, 9 Oct 2013 12:52:33 +0200 Subject: ipa-adtrust-install: Add warning that we will break existing samba configuration In case /etc/samba/smb.conf exists and it was not created by ipa-adtrust-install, print a warning that we will break existing samba configuration and ask for a confirmation in the interactive mode. Part of: https://fedorahosted.org/freeipa/ticket/3479 --- install/tools/ipa-adtrust-install | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'install/tools') diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 2af2df92..badb483a 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -264,13 +264,25 @@ def main(): allow_empty = False): sys.exit("Aborting installation.") + # Check if /etc/samba/smb.conf already exists. In case it was not generated + # by IPA, print a warning that we will break existing configuration. + if adtrustinstance.ipa_smb_conf_exists(): if not options.unattended: - while True: print "IPA generated smb.conf detected." - if not ipautil.user_input("Overwrite smb.conf?", default = False, allow_empty = False): + if not ipautil.user_input("Overwrite smb.conf?", + default = False, + allow_empty = False): sys.exit("Aborting installation.") - break + + elif os.path.exists('/etc/samba/smb.conf'): + print("WARNING: The smb.conf already exists. Running ipa-adtrust-install + "will break your existing samba configuration.\n\n") + if not options.unattended: + if not ipautil.user_input("Do you wish to continue?", + default = False, + allow_empty = False): + sys.exit("Aborting installation.") if not options.unattended and not options.enable_compat: options.enable_compat = enable_compat_tree() -- cgit