6
6
7
7
8
8
def update_config_paths ():
9
- find_output = subprocess .Popen (['find' , '/' , '-name' , 'GSbSFZwWV1mig4vFSmbLW9iP8TfGfMYCPfHTqGcD' ], stdout = subprocess .PIPE )
10
- project_path_raw , err = find_output .communicate ()
11
- project_path = str (project_path_raw .decode ('utf-8' ))[:- 42 ]
9
+ project_path = os .path .dirname (os .path .abspath (__file__ ))
12
10
13
11
os .system ('sudo cp -a Reset\ Device/static_files/rc.local.aphost.template Reset\ Device/static_files/rc.local.aphost' )
14
12
os .system ('sudo cp -a Reset\ Device/static_files/rc.local.apclient.template Reset\ Device/static_files/rc.local.apclient' )
@@ -18,12 +16,12 @@ def update_config_paths():
18
16
for line in file :
19
17
print (line .replace ("[[project_dir]]" , project_path ), end = '' )
20
18
file .close
21
-
19
+
22
20
with fileinput .FileInput ("Reset Device/static_files/rc.local.apclient" , inplace = True ) as file :
23
21
for line in file :
24
22
print (line .replace ("[[project_dir]]" , project_path ), end = '' )
25
23
file .close
26
-
24
+
27
25
with fileinput .FileInput ("Reset Device/reset.py" , inplace = True ) as file :
28
26
for line in file :
29
27
print (line .replace ("[[project_dir]]" , project_path ), end = '' )
@@ -44,10 +42,10 @@ def update_config_paths():
44
42
45
43
if (run_setup_ans == 'y' ):
46
44
print ()
47
- print ("Detecting RaspiWiFi location ..." )
48
-
45
+ print ("Running initial configuration ..." )
46
+
49
47
update_config_paths ()
50
-
48
+
51
49
os .system ('sudo rm -f /etc/wpa_supplicant/wpa_supplicant.conf' )
52
50
os .system ('rm -f ./tmp/*' )
53
51
os .system ('sudo cp -r ./Reset\ Device/static_files/dhcpd.conf /etc/dhcp/' )
0 commit comments