diff --git a/src/etc/rc.subr.d/recover b/src/etc/rc.subr.d/recover index c5f3aba9a..d790ba4c8 100755 --- a/src/etc/rc.subr.d/recover +++ b/src/etc/rc.subr.d/recover @@ -2,7 +2,7 @@ + * Copyright (c) 2015-2020 Franco Fichtner * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -280,6 +280,14 @@ function recover_pkg() { recover_ports(); recover_rebuild(); + + echo "===> Restoring critical core files\n"; + + foreach (['/usr/local/etc/bogons', '/usr/local/etc/bogonsv6'] as $file) { + if (!file_exists($file) || filesize($file) === 0) { + @copy("{$file}.sample", $file); + } + } } $stage = isset($argv[1]) ? $argv[1] : 'both';