Skip to content

Commit

Permalink
Read config files from new location after they have been migrated to …
Browse files Browse the repository at this point in the history
…after pi-hole/pi-hole#5479

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Nov 6, 2023
1 parent afb6f86 commit 6c31f15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions src/config/dnsmasq_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ bool read_legacy_dhcp_static_config(void)
{
// Check if file exists, if not, there is nothing to do
const char *path = DNSMASQ_STATIC_LEASES;
const char *target = DNSMASQ_STATIC_LEASES".bck";
if(!file_exists(path))
return true;

Expand Down Expand Up @@ -645,11 +644,6 @@ bool read_legacy_dhcp_static_config(void)
return false;
}

// Move file to backup location
log_info("Moving %s to %s", path, target);
if(rename(path, target) != 0)
log_warn("Unable to move %s to %s: %s", path, target, strerror(errno));

return true;
}

Expand All @@ -658,7 +652,6 @@ bool read_legacy_cnames_config(void)
{
// Check if file exists, if not, there is nothing to do
const char *path = DNSMASQ_CNAMES;
const char *target = DNSMASQ_CNAMES".bck";
if(!file_exists(path))
return true;

Expand Down Expand Up @@ -708,11 +701,6 @@ bool read_legacy_cnames_config(void)
return false;
}

// Move file to backup location
log_info("Moving %s to %s", path, target);
if(rename(path, target) != 0)
log_warn("Unable to move %s to %s: %s", path, target, strerror(errno));

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/config/dnsmasq_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ bool write_custom_list(void);

#define DNSMASQ_PH_CONFIG "/etc/pihole/dnsmasq.conf"
#define DNSMASQ_TEMP_CONF "/etc/pihole/dnsmasq.conf.temp"
#define DNSMASQ_STATIC_LEASES "/etc/pihole/04-pihole-static-dhcp.conf"
#define DNSMASQ_CNAMES "/etc/pihole/05-pihole-custom-cname.conf"
#define DNSMASQ_STATIC_LEASES "/etc/pihole/migration_backup_v6/04-pihole-static-dhcp.conf"
#define DNSMASQ_CNAMES "/etc/pihole/migration_backup_v6/05-pihole-custom-cname.conf"
#define DNSMASQ_CUSTOM_LIST "/etc/pihole/custom.list"
#define DHCPLEASESFILE "/etc/pihole/dhcp.leases"

Expand Down

0 comments on commit 6c31f15

Please sign in to comment.