lib/freewifi/mikrotik/newhub_mtik_ssh.rb in freewifi-0.1.5 vs lib/freewifi/mikrotik/newhub_mtik_ssh.rb in freewifi-0.1.6

- old
+ new

@@ -295,10 +295,20 @@ end def set_capsman_config_1(wifissid, capsman1, capsman_user1, capsman_pass1, ap_ip, companyname) + input_params ={:wifissid => wifissid, + :capsman1 => capsman1, + :capsman_user1 => capsman_user1, + :capsman_pass1 => capsman_pass1, + :ap_ip => ap_ip, + :companyname => companyname + } + output_params = {} + + begin Net::SSH.start(capsman1, capsman_user1, :password => capsman_pass1) do |ssh| result = ssh.exec!("/caps-man configuration print where ssid=#{wifissid}") if result == "\r\n" || result == "" || result == nil self.capsman_new_configuration_1(wifissid, capsman1, capsman_user1, capsman_pass1, ap_ip, companyname) else @@ -313,9 +323,16 @@ end end self.capsman_add_ip_to_existed_1(conf_names, capsman1, capsman_user1, capsman_pass1, ap_ip) end end + rescue + output_params = {:code => 507, :result => "set_capsman_config_1: Unknown SDK error"} + end + + additional_func_wifi_1.printer_texter_wifi_1({:input_params => input_params, :output_params => output_params, :procedure => "set_capsman_config_1", :file => "freewifi/mikrotik/newhub_mtik_ssh.rb", :sdk => "freewifi"}, "debug") + output_params + end end \ No newline at end of file