#! /usr/bin/env ruby begin APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) require APP_PATH begin Rails.application.require_environment! rescue ActiveRecord::AdapterNotSpecified => e error "No such Rails environment: \"#{Rails.env}\"." exit 1 end phones = Phone.where(:nightly_reboot => true).each do |phone| if ! phone.user_logout $stderr.puts "#{phone.id} #{phone.mac_address} - #{phone.errors.messages.inspect}" end end rescue SignalException => e $stderr.print "#{e.class.to_s}" $stderr.print " (Signal #{e.signo.to_s})" if e.respond_to?(:signo) && e.signo $stderr.puts "" exit 130 end exit 0