freewifi 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +96 -47
- data/lib/freewifi/config.rb +1 -1
- data/lib/freewifi/database/mongo/mongoconnector.rb +7 -1
- data/lib/freewifi/mikrotik/newhub_mtik_ssh.rb +17 -0
- data/lib/freewifi/mikrotik/schemes_conf_gen.rb +1 -1
- data/lib/freewifi/version.rb +1 -1
- data/lib/freewifi.rb +17 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ca9ed5225deb86d8e6f475e0a964621722c6dac
|
4
|
+
data.tar.gz: 75f1284ab9c76daf14a612b98b5b4aeed9f1c773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78c84f2fca76d2a855702f45a63a60983c31e7651373e40bda6673a4922e6ff05aa3e161631072cff53d9fc336452ffb58c9c5fec9743d08c7a73025b2ccea11
|
7
|
+
data.tar.gz: 2a7cbbf1349f6f96a39ff345e1280e9ac354d069ab8a4bdba8145cde9845ea1a864f8380543b8c79ecbebe9bb51801bef51d4583ec5d98ddb79d7bf6f451a643
|
data/.idea/workspace.xml
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
<component name="ChangesViewManager" flattened_view="false" />
|
43
43
|
<component name="CoverageDataManager">
|
44
44
|
<SUITE FILE_PATH="coverage/freewifi@additional_functions.coverage" NAME="additional_functions Coverage Results" MODIFIED="1588023723762" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/additional" MODULE_NAME="freewifi" />
|
45
|
-
<SUITE FILE_PATH="coverage/freewifi@test_helper.coverage" NAME="test_helper Coverage Results" MODIFIED="
|
45
|
+
<SUITE FILE_PATH="coverage/freewifi@test_helper.coverage" NAME="test_helper Coverage Results" MODIFIED="1588031683910" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
|
46
46
|
<SUITE FILE_PATH="coverage/freewifi@test.coverage" NAME="test Coverage Results" MODIFIED="1587924491650" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
|
47
47
|
<SUITE FILE_PATH="coverage/freewifi@hewhub_mtik_ssh.coverage" NAME="hewhub_mtik_ssh Coverage Results" MODIFIED="1587796347972" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/mikrotik" MODULE_NAME="freewifi" />
|
48
48
|
</component>
|
@@ -52,38 +52,38 @@
|
|
52
52
|
<file leaf-file-name="freewifi.rb" pinned="false" current-in-tab="false">
|
53
53
|
<entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
|
54
54
|
<provider selected="true" editor-type-id="text-editor">
|
55
|
-
<state relative-caret-position="
|
56
|
-
<caret line="
|
55
|
+
<state relative-caret-position="-831">
|
56
|
+
<caret line="41" column="201" lean-forward="false" selection-start-line="41" selection-start-column="201" selection-end-line="41" selection-end-column="201" />
|
57
57
|
<folding />
|
58
58
|
</state>
|
59
59
|
</provider>
|
60
60
|
</entry>
|
61
61
|
</file>
|
62
|
-
<file leaf-file-name="
|
63
|
-
<entry file="file://$PROJECT_DIR$/
|
62
|
+
<file leaf-file-name="test_helper.rb" pinned="false" current-in-tab="true">
|
63
|
+
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
64
64
|
<provider selected="true" editor-type-id="text-editor">
|
65
|
-
<state relative-caret-position="
|
66
|
-
<caret line="
|
65
|
+
<state relative-caret-position="344">
|
66
|
+
<caret line="32" column="177" lean-forward="false" selection-start-line="32" selection-start-column="177" selection-end-line="32" selection-end-column="177" />
|
67
67
|
<folding />
|
68
68
|
</state>
|
69
69
|
</provider>
|
70
70
|
</entry>
|
71
71
|
</file>
|
72
|
-
<file leaf-file-name="
|
73
|
-
<entry file="file://$PROJECT_DIR$/
|
72
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
73
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
|
74
74
|
<provider selected="true" editor-type-id="text-editor">
|
75
|
-
<state relative-caret-position="
|
76
|
-
<caret line="
|
75
|
+
<state relative-caret-position="45">
|
76
|
+
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
77
77
|
<folding />
|
78
78
|
</state>
|
79
79
|
</provider>
|
80
80
|
</entry>
|
81
81
|
</file>
|
82
|
-
<file leaf-file-name="
|
83
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/
|
82
|
+
<file leaf-file-name="newhub_mtik_ssh.rb" pinned="false" current-in-tab="false">
|
83
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_ssh.rb">
|
84
84
|
<provider selected="true" editor-type-id="text-editor">
|
85
|
-
<state relative-caret-position="
|
86
|
-
<caret line="
|
85
|
+
<state relative-caret-position="1025">
|
86
|
+
<caret line="307" column="0" lean-forward="true" selection-start-line="307" selection-start-column="0" selection-end-line="307" selection-end-column="0" />
|
87
87
|
<folding />
|
88
88
|
</state>
|
89
89
|
</provider>
|
@@ -92,8 +92,8 @@
|
|
92
92
|
<file leaf-file-name="mongoconnector.rb" pinned="false" current-in-tab="false">
|
93
93
|
<entry file="file://$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb">
|
94
94
|
<provider selected="true" editor-type-id="text-editor">
|
95
|
-
<state relative-caret-position="
|
96
|
-
<caret line="
|
95
|
+
<state relative-caret-position="384">
|
96
|
+
<caret line="79" column="17" lean-forward="true" selection-start-line="79" selection-start-column="17" selection-end-line="79" selection-end-column="17" />
|
97
97
|
<folding />
|
98
98
|
</state>
|
99
99
|
</provider>
|
@@ -141,17 +141,17 @@
|
|
141
141
|
<option value="$PROJECT_DIR$/test/test.rb" />
|
142
142
|
<option value="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods.rb" />
|
143
143
|
<option value="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods_wifi.rb" />
|
144
|
-
<option value="$PROJECT_DIR$/lib/freewifi/version.rb" />
|
145
144
|
<option value="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods_wifi_1.rb" />
|
146
145
|
<option value="$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb" />
|
147
146
|
<option value="$PROJECT_DIR$/lib/freewifi/cisco/cisco_schemes_conf_gen.rb" />
|
148
|
-
<option value="$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_ssh.rb" />
|
149
147
|
<option value="$PROJECT_DIR$/freewifi.gemspec" />
|
150
148
|
<option value="$PROJECT_DIR$/lib/freewifi/params.rb" />
|
151
|
-
<option value="$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb" />
|
152
|
-
<option value="$PROJECT_DIR$/lib/freewifi/config.rb" />
|
153
149
|
<option value="$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb" />
|
150
|
+
<option value="$PROJECT_DIR$/lib/freewifi/version.rb" />
|
154
151
|
<option value="$PROJECT_DIR$/lib/freewifi/mikrotik/schemes_conf_gen.rb" />
|
152
|
+
<option value="$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb" />
|
153
|
+
<option value="$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_ssh.rb" />
|
154
|
+
<option value="$PROJECT_DIR$/lib/freewifi/config.rb" />
|
155
155
|
<option value="$PROJECT_DIR$/lib/freewifi.rb" />
|
156
156
|
<option value="$PROJECT_DIR$/test/test_helper.rb" />
|
157
157
|
</list>
|
@@ -263,6 +263,54 @@
|
|
263
263
|
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
264
264
|
</PATH_ELEMENT>
|
265
265
|
</PATH>
|
266
|
+
<PATH>
|
267
|
+
<PATH_ELEMENT>
|
268
|
+
<option name="myItemId" value="freewifi" />
|
269
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
270
|
+
</PATH_ELEMENT>
|
271
|
+
<PATH_ELEMENT>
|
272
|
+
<option name="myItemId" value="freewifi" />
|
273
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
274
|
+
</PATH_ELEMENT>
|
275
|
+
<PATH_ELEMENT>
|
276
|
+
<option name="myItemId" value="lib" />
|
277
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
278
|
+
</PATH_ELEMENT>
|
279
|
+
<PATH_ELEMENT>
|
280
|
+
<option name="myItemId" value="freewifi" />
|
281
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
282
|
+
</PATH_ELEMENT>
|
283
|
+
<PATH_ELEMENT>
|
284
|
+
<option name="myItemId" value="database" />
|
285
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
286
|
+
</PATH_ELEMENT>
|
287
|
+
</PATH>
|
288
|
+
<PATH>
|
289
|
+
<PATH_ELEMENT>
|
290
|
+
<option name="myItemId" value="freewifi" />
|
291
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
292
|
+
</PATH_ELEMENT>
|
293
|
+
<PATH_ELEMENT>
|
294
|
+
<option name="myItemId" value="freewifi" />
|
295
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
296
|
+
</PATH_ELEMENT>
|
297
|
+
<PATH_ELEMENT>
|
298
|
+
<option name="myItemId" value="lib" />
|
299
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
300
|
+
</PATH_ELEMENT>
|
301
|
+
<PATH_ELEMENT>
|
302
|
+
<option name="myItemId" value="freewifi" />
|
303
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
304
|
+
</PATH_ELEMENT>
|
305
|
+
<PATH_ELEMENT>
|
306
|
+
<option name="myItemId" value="database" />
|
307
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
308
|
+
</PATH_ELEMENT>
|
309
|
+
<PATH_ELEMENT>
|
310
|
+
<option name="myItemId" value="mongo" />
|
311
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
312
|
+
</PATH_ELEMENT>
|
313
|
+
</PATH>
|
266
314
|
<PATH>
|
267
315
|
<PATH_ELEMENT>
|
268
316
|
<option name="myItemId" value="freewifi" />
|
@@ -540,15 +588,16 @@
|
|
540
588
|
<workItem from="1586354062505" duration="297000" />
|
541
589
|
<workItem from="1586463231468" duration="598000" />
|
542
590
|
<workItem from="1587794173933" duration="25602000" />
|
543
|
-
<workItem from="1588004674911" duration="
|
591
|
+
<workItem from="1588004674911" duration="21769000" />
|
544
592
|
</task>
|
545
593
|
<servers />
|
546
594
|
</component>
|
547
595
|
<component name="TimeTrackingManager">
|
548
|
-
<option name="totallyTimeSpent" value="
|
596
|
+
<option name="totallyTimeSpent" value="59503000" />
|
549
597
|
</component>
|
550
598
|
<component name="ToolWindowManager">
|
551
599
|
<frame x="0" y="0" width="1440" height="900" extended-state="6" />
|
600
|
+
<editor active="true" />
|
552
601
|
<layout>
|
553
602
|
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24177396" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
554
603
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
@@ -912,74 +961,74 @@
|
|
912
961
|
</state>
|
913
962
|
</provider>
|
914
963
|
</entry>
|
915
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/
|
964
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/params.rb">
|
916
965
|
<provider selected="true" editor-type-id="text-editor">
|
917
|
-
<state relative-caret-position="
|
918
|
-
<caret line="
|
966
|
+
<state relative-caret-position="41700">
|
967
|
+
<caret line="4" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
919
968
|
<folding />
|
920
969
|
</state>
|
921
970
|
</provider>
|
922
971
|
</entry>
|
923
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/
|
972
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb">
|
924
973
|
<provider selected="true" editor-type-id="text-editor">
|
925
|
-
<state relative-caret-position="
|
926
|
-
<caret line="
|
974
|
+
<state relative-caret-position="422">
|
975
|
+
<caret line="53" column="47" lean-forward="true" selection-start-line="53" selection-start-column="6" selection-end-line="53" selection-end-column="47" />
|
927
976
|
<folding />
|
928
977
|
</state>
|
929
978
|
</provider>
|
930
979
|
</entry>
|
931
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/
|
980
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/config.rb">
|
932
981
|
<provider selected="true" editor-type-id="text-editor">
|
933
|
-
<state relative-caret-position="
|
934
|
-
<caret line="4" column="0" lean-forward="
|
982
|
+
<state relative-caret-position="60">
|
983
|
+
<caret line="4" column="0" lean-forward="true" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
935
984
|
<folding />
|
936
985
|
</state>
|
937
986
|
</provider>
|
938
987
|
</entry>
|
939
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/
|
988
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/schemes_conf_gen.rb">
|
940
989
|
<provider selected="true" editor-type-id="text-editor">
|
941
|
-
<state relative-caret-position="
|
942
|
-
<caret line="
|
990
|
+
<state relative-caret-position="358">
|
991
|
+
<caret line="32" column="5" lean-forward="true" selection-start-line="32" selection-start-column="5" selection-end-line="32" selection-end-column="5" />
|
943
992
|
<folding />
|
944
993
|
</state>
|
945
994
|
</provider>
|
946
995
|
</entry>
|
947
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/
|
996
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
|
948
997
|
<provider selected="true" editor-type-id="text-editor">
|
949
|
-
<state relative-caret-position="
|
950
|
-
<caret line="
|
998
|
+
<state relative-caret-position="45">
|
999
|
+
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
951
1000
|
<folding />
|
952
1001
|
</state>
|
953
1002
|
</provider>
|
954
1003
|
</entry>
|
955
1004
|
<entry file="file://$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb">
|
956
1005
|
<provider selected="true" editor-type-id="text-editor">
|
957
|
-
<state relative-caret-position="
|
958
|
-
<caret line="
|
1006
|
+
<state relative-caret-position="384">
|
1007
|
+
<caret line="79" column="17" lean-forward="true" selection-start-line="79" selection-start-column="17" selection-end-line="79" selection-end-column="17" />
|
959
1008
|
<folding />
|
960
1009
|
</state>
|
961
1010
|
</provider>
|
962
1011
|
</entry>
|
963
|
-
<entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/
|
1012
|
+
<entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_ssh.rb">
|
964
1013
|
<provider selected="true" editor-type-id="text-editor">
|
965
|
-
<state relative-caret-position="
|
966
|
-
<caret line="
|
1014
|
+
<state relative-caret-position="1025">
|
1015
|
+
<caret line="307" column="0" lean-forward="true" selection-start-line="307" selection-start-column="0" selection-end-line="307" selection-end-column="0" />
|
967
1016
|
<folding />
|
968
1017
|
</state>
|
969
1018
|
</provider>
|
970
1019
|
</entry>
|
971
1020
|
<entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
|
972
1021
|
<provider selected="true" editor-type-id="text-editor">
|
973
|
-
<state relative-caret-position="
|
974
|
-
<caret line="
|
1022
|
+
<state relative-caret-position="-831">
|
1023
|
+
<caret line="41" column="201" lean-forward="false" selection-start-line="41" selection-start-column="201" selection-end-line="41" selection-end-column="201" />
|
975
1024
|
<folding />
|
976
1025
|
</state>
|
977
1026
|
</provider>
|
978
1027
|
</entry>
|
979
1028
|
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
980
1029
|
<provider selected="true" editor-type-id="text-editor">
|
981
|
-
<state relative-caret-position="
|
982
|
-
<caret line="
|
1030
|
+
<state relative-caret-position="344">
|
1031
|
+
<caret line="32" column="177" lean-forward="false" selection-start-line="32" selection-start-column="177" selection-end-line="32" selection-end-column="177" />
|
983
1032
|
<folding />
|
984
1033
|
</state>
|
985
1034
|
</provider>
|
data/lib/freewifi/config.rb
CHANGED
@@ -66,7 +66,13 @@ class MongoWifiCl_1
|
|
66
66
|
result_ps << row
|
67
67
|
#result_ps.append(row)
|
68
68
|
}
|
69
|
-
|
69
|
+
tun_id = ""
|
70
|
+
if result_ps != []
|
71
|
+
if result_ps[0].key?("tunnel_id")
|
72
|
+
tun_id = result_ps[0]["tunnel_id"]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
output_params = {:code => 200, :result => "get_ap_info_sim_ip_wifi_1: Request completed successfully", :body => {:all_mongo => result_ps, :tunnel_id => tun_id }, :sdk => "freewifi"}
|
70
76
|
rescue
|
71
77
|
output_params = {:code => 500, :result => "get_ap_info_sim_ip_wifi_1: failed ", :sdk => "freewifi"}
|
72
78
|
end
|
@@ -297,6 +297,16 @@ class NEWhubWifi_1
|
|
297
297
|
|
298
298
|
|
299
299
|
def set_capsman_config_1(wifissid, capsman1, capsman_user1, capsman_pass1, ap_ip, companyname)
|
300
|
+
input_params ={:wifissid => wifissid,
|
301
|
+
:capsman1 => capsman1,
|
302
|
+
:capsman_user1 => capsman_user1,
|
303
|
+
:capsman_pass1 => capsman_pass1,
|
304
|
+
:ap_ip => ap_ip,
|
305
|
+
:companyname => companyname
|
306
|
+
}
|
307
|
+
output_params = {}
|
308
|
+
|
309
|
+
begin
|
300
310
|
Net::SSH.start(capsman1, capsman_user1, :password => capsman_pass1) do |ssh|
|
301
311
|
result = ssh.exec!("/caps-man configuration print where ssid=#{wifissid}")
|
302
312
|
if result == "\r\n" || result == "" || result == nil
|
@@ -315,6 +325,13 @@ class NEWhubWifi_1
|
|
315
325
|
self.capsman_add_ip_to_existed_1(conf_names, capsman1, capsman_user1, capsman_pass1, ap_ip)
|
316
326
|
end
|
317
327
|
end
|
328
|
+
rescue
|
329
|
+
output_params = {:code => 507, :result => "set_capsman_config_1: Unknown SDK error"}
|
330
|
+
end
|
331
|
+
|
332
|
+
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")
|
333
|
+
output_params
|
334
|
+
|
318
335
|
end
|
319
336
|
|
320
337
|
|
@@ -23,7 +23,7 @@ class MtikSchemesGen_1
|
|
23
23
|
"/interface ppp-client set ppp-out1 apn=vpn pin=1111 disabled=no",
|
24
24
|
"/interface wireless set wlan2 disabled=yes",
|
25
25
|
"/system clock set time-zone-name=Europe/Minsk",
|
26
|
-
|
26
|
+
%{/snmp community set numbers=0 name="RO2597" addresses=172.18.25.4/32,172.17.109.3/32 security=none read-access=yes write-access=no},
|
27
27
|
"/snmp set enabled=yes trap-community=RO2597 trap-version=2",
|
28
28
|
"/system ntp client set enabled=yes primary-ntp=172.24.213.41 secondary-ntp=172.18.25.10",
|
29
29
|
cap_conf,
|
data/lib/freewifi/version.rb
CHANGED
data/lib/freewifi.rb
CHANGED
@@ -39,7 +39,7 @@ module Freewifi_1
|
|
39
39
|
:capsman_ip_wifi
|
40
40
|
|
41
41
|
|
42
|
-
def initialize(hub1ip, hub2ip, username_hub, password_hub, database_username, database_password, database_host, mongo_ip, mongo_port, mongo_database, remote_ip, real_ip, subscriber_ip,
|
42
|
+
def initialize(hub1ip, hub2ip, username_hub, password_hub, database_username, database_password, database_host, mongo_ip, mongo_port, mongo_database, remote_ip, real_ip, subscriber_ip, capsman_ip_man, capsman_user, capsman_password, hub_vip, ap_admin_password, capsman_ip_wifi)
|
43
43
|
@mtik_hub1_ip = hub1ip
|
44
44
|
@mtik_hub2_ip = hub2ip
|
45
45
|
@user_hub = username_hub
|
@@ -51,7 +51,7 @@ module Freewifi_1
|
|
51
51
|
@remote_ip = remote_ip
|
52
52
|
@real_ip = real_ip
|
53
53
|
@subscriber_ip = subscriber_ip
|
54
|
-
@
|
54
|
+
@capsman_ip_man = capsman_ip_man
|
55
55
|
@capsman_user = capsman_user
|
56
56
|
@capsman_password = capsman_password
|
57
57
|
@mtik_config_gen_1 = MtikSchemesGen_1.new
|
@@ -118,16 +118,23 @@ module Freewifi_1
|
|
118
118
|
|
119
119
|
mongo_response = mongo_connector_wifi_1.data_ap_auto_created_insert_1(data)
|
120
120
|
if mongo_response[:code]==200
|
121
|
+
|
121
122
|
newcapsman1 = NEWhubWifi_1.new
|
123
|
+
threads_1 = []
|
124
|
+
capsman_ip_man.each do |capsman|
|
125
|
+
threads_1 << Thread.new do
|
126
|
+
wifi_ssid_processed = additional_func_wifi_1.prep_ssid_for_config_1(wifi_ssid)
|
127
|
+
company_name_processed = additional_func_wifi_1.prep_comp_name_for_config_1(company_name)
|
128
|
+
|
129
|
+
input_intern_data = {:wifi_ssid_processed =>wifi_ssid_processed, :company_name_processed =>company_name_processed, :capsman => capsman}
|
122
130
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
newcapsman1.set_capsman_config_1(additional_func_wifi_1.prep_ssid_for_config_1(wifi_ssid), capsman, capsman_user, capsman_password, sim_ipaddress, additional_func_wifi_1.prep_comp_name_for_config_1(company_name))
|
131
|
+
mongo_connector_wifi_1.audit_logger_wifi_1("add_mikrotik_ap_mobile_1", remote_ip, input_intern_data, nil, real_ip, subscriber_ip)
|
132
|
+
|
133
|
+
newcapsman1.set_capsman_config_1(wifi_ssid_processed, capsman, capsman_user, capsman_password, sim_ipaddress, company_name_processed)
|
127
134
|
end
|
128
135
|
end
|
129
|
-
|
130
|
-
|
136
|
+
threads_1.each(&:join)
|
137
|
+
|
131
138
|
output_params = {:code => 200, :result => "Request completed successfully", :body => {:tunnel_id => tunnel_addition[:body][:eoip_tunnel_id], :tunnel_name => tunnel_addition[:body][:eoip_tunnel_name]}}
|
132
139
|
else
|
133
140
|
output_params = {:code => 400, :result => "Something wrong with insertion to mongo"}
|
@@ -141,7 +148,7 @@ module Freewifi_1
|
|
141
148
|
rescue
|
142
149
|
output_params = {:code => 507, :result => "Unknown SDK error"}
|
143
150
|
end
|
144
|
-
mongo_connector_wifi_1.audit_logger_wifi_1("
|
151
|
+
mongo_connector_wifi_1.audit_logger_wifi_1("add_mikrotik_ap_mobile_1", remote_ip, input_params, output_params, real_ip, subscriber_ip)
|
145
152
|
#additional_func.printer_texter({:input_params => input_params, :output_params => output_params, :procedure => "add_mikrotik_ap_mobile", :file => "freewifi.rb"}, "info")
|
146
153
|
output_params
|
147
154
|
end
|
@@ -170,7 +177,7 @@ module Freewifi_1
|
|
170
177
|
tun_id = res[:body][:tunnel_id]
|
171
178
|
hostname = additional_func_wifi_1.ap_hostname_generator(company_name, tun_id)
|
172
179
|
conf_1 = mtik_config_gen_1.scheme1_3g_config_gen_1(hostname, tun_id, hub_vip, ap_admin_password, wifi_ssid, capsman_ip_wifi)
|
173
|
-
output_params = {:code =>
|
180
|
+
output_params = {:code => res[:code], :result => res[:result], :body => {:ap_configuration => conf_1}}
|
174
181
|
|
175
182
|
rescue
|
176
183
|
output_params = {:code => 507, :result => "Unknown SDK error"}
|