15881: Add LDAP option to install docs.
[arvados.git] / services / login-sync / bin / arvados-login-sync
index b42c784323e68f06fd8fc831c0cfa4293088fceb..e00495c04db7db621ba0bf377cbe62072b82feba 100755 (executable)
@@ -57,9 +57,7 @@ begin
 
   pwnam = Hash.new()
   logins.reject! do |l|
-    if pwnam[l[:username]]
-      false
-    else
+    if not pwnam[l[:username]]
       begin
         pwnam[l[:username]] = Etc.getpwnam(l[:username])
       rescue
@@ -110,7 +108,7 @@ begin
                 "-G", groups.join(","),
                 l[:username],
                 out: devnull)
-        STDERR.puts "Account creation failed for #{l[:username]}: $?"
+        STDERR.puts "Account creation failed for #{l[:username]}: #{$?}"
         next
       end
       begin
@@ -123,13 +121,13 @@ begin
 
     @homedir = pwnam[l[:username]].dir
     userdotssh = File.join(@homedir, ".ssh")
-    Dir.mkdir(userdotssh) if !File.exists?(userdotssh)
+    Dir.mkdir(userdotssh) if !File.exist?(userdotssh)
 
     newkeys = "###\n###\n" + keys[l[:username]].join("\n") + "\n###\n###\n"
 
     keysfile = File.join(userdotssh, "authorized_keys")
 
-    if File.exists?(keysfile)
+    if File.exist?(keysfile)
       oldkeys = IO::read(keysfile)
     else
       oldkeys = ""