summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20130203164500_remove_perimeter_parameters.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/db/migrate/20130203164500_remove_perimeter_parameters.rb b/db/migrate/20130203164500_remove_perimeter_parameters.rb
index 15838bb..8c37174 100644
--- a/db/migrate/20130203164500_remove_perimeter_parameters.rb
+++ b/db/migrate/20130203164500_remove_perimeter_parameters.rb
@@ -1,10 +1,16 @@
-class StartPerimeterDefense < ActiveRecord::Migration
+class RemovePerimeterParameters < ActiveRecord::Migration
def up
- module_index = GsParameter.where(:entity => 'events', :section => 'modules').all.count + 1;
- GsParameter.create(:entity => 'events', :section => 'modules', :name => 'perimeter_defense', :value => module_index, :class_type => 'Integer')
+ GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_count').destroy_all
+ GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_time_span').destroy_all
+ GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'ban_futile').destroy_all
+ GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'execute').destroy_all
+
end
def down
- GsParameter.where(:entity => 'events', :section => 'modules', :name => 'perimeter_defense').destroy_all
+ GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_count', :value => 20, :class_type => 'Integer')
+ GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_time_span', :value => 2, :class_type => 'Integer')
+ GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'ban_futile', :value => 5, :class_type => 'Integer')
+ GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'execute', :value => 'sudo /usr/local/bin/ban_ip.sh {ip_address}', :class_type => 'String')
end
end