@@ -466,15 +466,15 @@ GetConfigData:
466
466
put `Can't read the config file for ` cat SystemName cat `(` cat MAC cat `/` cat Password cat `)` into StatusMessage
467
467
go to Error
468
468
end
469
- log Value
469
+ ! log Value
470
470
! If the server has data, copy it into the local config
471
471
if Value is `""` put empty into Value
472
472
if Value is empty put `{}` into Value
473
473
if Value is not `{}`
474
474
begin
475
475
log `Add config data from the server`
476
476
put json Value into Value
477
- log prettify Value
477
+ ! log prettify Value
478
478
put the keys of Value into Keys
479
479
put 0 into K
480
480
while K is less than the count of Keys
@@ -891,28 +891,43 @@ PopulateSystemInfo:
891
891
put property `host-password` of SystemConfig into Password
892
892
if SystemHostSSID is not HostSSID
893
893
begin
894
- put `Unknown host SSID ` cat SystemHostSSID into StatusMessage
894
+ put `Different host SSID: ` cat SystemHostSSID into StatusMessage
895
895
gosub to Working
896
- put SystemHostSSID into HostSSID
897
- put Password into HostPassword
898
- put system `nmcli dev wifi connect ` cat HostSSID cat ` password ` cat HostPassword into SystemCallResult
899
- split SystemCallResult on ` `
900
- if the elements of SystemCallResult is greater than 2
896
+ create MessageBox on Window
897
+ style question
898
+ title `Move system`
899
+ message `Shall I move the system to the current host (` cat HostSSID cat `)?`
900
+ show MessageBox giving Value
901
+ if Value is `Yes`
901
902
begin
902
- index SystemCallResult to 2
903
- if SystemCallResult is `successfully`
904
- begin
905
- set property HostSSID of Hosts to HostPassword
906
- set property `hosts` of Config to Hosts
907
- gosub to PostConfigData
908
- put HostSSID into CurrentSSID
909
- put `Connected to ` cat HostSSID into StatusMessage
910
- gosub to Working
911
- end
912
- else
903
+ put HostSSID into SystemHostSSID
904
+ set property `host-ssid` of SystemConfig to HostSSID
905
+ set property `host-password` of SystemConfig to HostPassword
906
+ gosub to UpdateSystems
907
+ end
908
+ else
909
+ begin
910
+ put SystemHostSSID into HostSSID
911
+ put Password into HostPassword
912
+ put system `nmcli dev wifi connect ` cat HostSSID cat ` password ` cat HostPassword into SystemCallResult
913
+ split SystemCallResult on ` `
914
+ if the elements of SystemCallResult is greater than 2
913
915
begin
914
- put `Failed to connect to ` cat HostSSID into StatusMessage
915
- go to Error
916
+ index SystemCallResult to 2
917
+ if SystemCallResult is `successfully`
918
+ begin
919
+ set property HostSSID of Hosts to HostPassword
920
+ set property `hosts` of Config to Hosts
921
+ gosub to PostConfigData
922
+ put HostSSID into CurrentSSID
923
+ put `Connected to ` cat HostSSID into StatusMessage
924
+ gosub to Working
925
+ end
926
+ else
927
+ begin
928
+ put `Failed to connect to ` cat HostSSID into StatusMessage
929
+ go to Error
930
+ end
916
931
end
917
932
end
918
933
end
0 commit comments