#!/usr/bin/ruby # get all users USERS = `ls /home/`.split POSSIBLE = [] # get list of only those that have both web and gemini active USERS.each { |user| if File.exists? "/home/#{user}/public_html/index.html" \ and File.exists? "/home/#{user}/public_gemini/index.gmi" \ and user != "de_alchmst" POSSIBLE.push user end } # choose one print POSSIBLE.sample