ud-useradd: If we do not have a template for a specific group, use the general purpos...
[mirror/userdir-ldap.git] / ud-useradd
index c183dca..ee04983 100755 (executable)
@@ -326,7 +326,10 @@ if Update == 1 and ForceMail == 0:
 
 # Send the Welcome message
 print "Sending Welcome Email"
-Reply = TemplateSubst(Subst,open(TemplatesDir + "/welcome-message-%d" % int(gidNumber), "r").read())
+templatepath = TemplatesDir + "/welcome-message-%d" % int(gidNumber)
+if not os.path.exists(templatepath):
+   templatepath = TemplatesDir + "/welcome-message"
+Reply = TemplateSubst(Subst,open(templatepath, "r").read())
 Child = os.popen("/usr/sbin/sendmail -t","w");
 #Child = os.popen("cat","w");
 Child.write(Reply);