Skip to content

Commit 017d356

Browse files
committed
installer: Fix TPLink install with --skip-sdcard
Correct the paths used during install to not assume an SDcard is present
1 parent b00f17d commit 017d356

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

installer/src/tplink.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,23 @@ async fn tplink_run_install(
152152
// there is too little space on the internal flash to store anything, but the initrd script
153153
// expects things to be at this location
154154
telnet_send_command(addr, "rm -rf /data/rayhunter", "exit code 0", true).await?;
155-
telnet_send_command(addr, "mkdir -p /data", "exit code 0", true).await?;
156-
telnet_send_command(
157-
addr,
158-
&format!("ln -sf {sdcard_path} /data/rayhunter"),
159-
"exit code 0",
160-
true,
161-
)
162-
.await?;
155+
156+
if skip_sdcard {
157+
telnet_send_command(addr, "mkdir -p /data/rayhunter", "exit code 0", true).await?;
158+
} else {
159+
telnet_send_command(addr, "mkdir -p /data", "exit code 0", true).await?;
160+
telnet_send_command(
161+
addr,
162+
&format!("ln -sf {sdcard_path} /data/rayhunter"),
163+
"exit code 0",
164+
true,
165+
)
166+
.await?;
167+
}
163168

164169
telnet_send_file(
165170
addr,
166-
&format!("{sdcard_path}/config.toml"),
171+
&format!("/data/rayhunter/config.toml"),
167172
crate::CONFIG_TOML
168173
.replace("#device = \"orbic\"", "device = \"tplink\"")
169174
.as_bytes(),
@@ -175,7 +180,7 @@ async fn tplink_run_install(
175180

176181
telnet_send_file(
177182
addr,
178-
&format!("{sdcard_path}/rayhunter-daemon"),
183+
&format!("/data/rayhunter/rayhunter-daemon"),
179184
rayhunter_daemon_bin,
180185
true,
181186
)
@@ -191,7 +196,7 @@ async fn tplink_run_install(
191196

192197
telnet_send_command(
193198
addr,
194-
&format!("chmod ugo+x {sdcard_path}/rayhunter-daemon"),
199+
&format!("chmod ugo+x /data/rayhunter/rayhunter-daemon"),
195200
"exit code 0",
196201
true,
197202
)

0 commit comments

Comments
 (0)