diff --git a/bin/noprocast b/bin/noprocast index 58e0b95..f549de7 100644 --- a/bin/noprocast +++ b/bin/noprocast @@ -4,7 +4,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'noproc begin case ARGV.first - when 'on' + when 'on', 'reload' Noprocast.activate! when 'off' Noprocast.deactivate! @@ -16,6 +16,11 @@ begin exit end Noprocast.edit! + if Noprocast.active? + puts "Saved. Now: noprocast reload" + else + puts "Saved. Now: noprocast on" + end when 'help', '-h', '--help', nil puts "Usage: [sudo] noprocast [on|off|status|edit]" end diff --git a/lib/noprocast.rb b/lib/noprocast.rb index 2be04b9..16ac85f 100644 --- a/lib/noprocast.rb +++ b/lib/noprocast.rb @@ -12,7 +12,7 @@ class Noprocast def current_hosts setup_deny_file_if_required! - File.read(deny_file_path).split(/\n/).map(&:strip) + File.read(deny_file_path).split(/\n/).select { |line| line.match(/[a-zA-Z0-9]/) }.map(&:strip) end def hosts_file_content