Skip to content

Commit

Permalink
fix: correct command syntax for managing captive domains in ping_thread
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Jan 7, 2025
1 parent de5870b commit d373c01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ping_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ make_captive_domains_query_responsable(void)
if (domains_added) {
for (int i = 0; i < sizeof(captive_domains)/sizeof(captive_domains[0]); i++) {
char cmd[256] = {0};
snprintf(cmd, sizeof(cmd), "uci -q del dhcp.@dnsmasq[0].address=/%s/1.1.1.1/", captive_domains[i]);
snprintf(cmd, sizeof(cmd), "uci -q delete dhcp.@dnsmasq[0].address=/%s/1.1.1.1/", captive_domains[i]);
system(cmd);
}
system("uci commit dhcp && /etc/init.d/dnsmasq restart >/dev/null 2>&1");
Expand All @@ -99,7 +99,7 @@ make_captive_domains_query_responsable(void)
// Add all captive domains when offline
char cmd[256] = {0};
for (int i = 0; i < sizeof(captive_domains)/sizeof(captive_domains[0]); i++) {
snprintf(cmd, sizeof(cmd), "uci -q add dhcp.@dnsmasq[0].address=/%s/1.1.1.1/", captive_domains[i]);
snprintf(cmd, sizeof(cmd), "uci -q set dhcp.@dnsmasq[0].address=/%s/1.1.1.1/", captive_domains[i]);
system(cmd);
}
system("uci commit dhcp && /etc/init.d/dnsmasq restart >/dev/null 2>&1");
Expand Down

0 comments on commit d373c01

Please sign in to comment.