Skip to content

Commit 4a184dc

Browse files
committed
Added compatibility fixes for Raspbian Stretch. Also removed depricated method of detecting the install directory for use with configuration files
1 parent 96d4b44 commit 4a184dc

File tree

1 file changed

+8
-4
lines changed
  • Configuration App/app/models

1 file changed

+8
-4
lines changed

Configuration App/app/models/main.rb

100755100644
+8-4
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,14 @@ def self.create_wpa_supplicant(user_ssid, encryption_type, user_wifi_key)
104104

105105
def self.set_ap_client_mode
106106
raspiwifi_path = find_raspiwifi_path()
107+
lsb_release_string = %x{lsb_release -a}
108+
109+
if lsb_release_string.include?('jessie')
110+
system ('sudo cp -r ' + raspiwifi_path + '/Reset\ Device/static_files/interfaces.apclient /etc/network/interfaces')
111+
elsif lsb_release_string.include?('stretch')
112+
system ('sudo rm /etc/network/interfaces')
113+
end
107114

108-
#system ('sudo cp -r ' + raspiwifi_path + '/Reset\ Device/static_files/interfaces.apclient /etc/network/interfaces')
109-
system ('sudo rm /etc/network/interfaces')
110115
system ('sudo cp -r ' + raspiwifi_path + '/Reset\ Device/static_files/rc.local.apclient /etc/rc.local')
111116
system ('sudo cp -r ' + raspiwifi_path + '/Reset\ Device/static_files/isc-dhcp-server.apclient /etc/default/isc-dhcp-server')
112117
system ('sudo reboot')
@@ -123,8 +128,7 @@ def self.reset_all
123128
end
124129

125130
def self.find_raspiwifi_path
126-
find_path = %x(sudo find / -name "GSbSFZwWV1mig4vFSmbLW9iP8TfGfMYCPfHTqGcD")
127-
raspiwifi_path = find_path[0..-43]
131+
raspiwifi_path = File.dirname(__FILE__)[0..-30]
128132

129133
raspiwifi_path
130134
end

0 commit comments

Comments
 (0)