File tree 2 files changed +0
-23
lines changed
2 files changed +0
-23
lines changed Original file line number Diff line number Diff line change 1
1
class MainController < ApplicationController
2
2
3
3
def index
4
- @current_values = Main . get_current_config_values
5
4
@wifi_ap_array = Main . scan_wifi_networks
6
5
end
7
6
Original file line number Diff line number Diff line change @@ -21,28 +21,6 @@ def self.scan_wifi_networks
21
21
ap_array
22
22
end
23
23
24
- def self . get_current_config_values
25
- current_values = Array . new
26
-
27
- if File . exist? ( '/etc/wpa_supplicant/wpa_supplicant.conf' )
28
- wpa_supplicant_file = File . open ( '/etc/wpa_supplicant/wpa_supplicant.conf' , 'r' )
29
-
30
- wpa_supplicant_file . each { |line |
31
- if line . include? ( 'ssid=' )
32
- current_values << line . split ( '=' ) [ 1 ] . chomp [ 1 ..-2 ]
33
- elsif line . include? ( 'psk=' )
34
- current_values << line . split ( '=' ) [ 1 ] . chomp [ 1 ..-2 ]
35
- end
36
- }
37
-
38
- wpa_supplicant_file . close
39
- else
40
- current_values << ''
41
- end
42
-
43
- current_values
44
- end
45
-
46
24
def self . create_wpa_supplicant ( ssid , wifi_key )
47
25
temp_conf_file = File . new ( '../tmp/wpa_supplicant.conf.tmp' , 'w' )
48
26
You can’t perform that action at this time.
0 commit comments