mirror of
https://codeberg.org/h3xx/you-dont-need-pihole.git
synced 2024-08-14 20:27:01 +00:00
Fix blocklist permissions on first generation
This commit is contained in:
parent
8fbca993fa
commit
afa73e31f6
2 changed files with 15 additions and 0 deletions
|
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Fixed
|
### Fixed
|
||||||
- Prevent AdroitAdorKhan-EnergizedProtection updates (current repo has a broken
|
- Prevent AdroitAdorKhan-EnergizedProtection updates (current repo has a broken
|
||||||
list)
|
list)
|
||||||
|
- Fix `block.list` permissions on first generation.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
- Removed in-repo custom ad domains list
|
- Removed in-repo custom ad domains list
|
||||||
|
|
14
update.sh
14
update.sh
|
@ -92,6 +92,20 @@ done
|
||||||
|
|
||||||
TEMP_BLOCKLIST=$(mktemp -p "$TEMP_DIR")
|
TEMP_BLOCKLIST=$(mktemp -p "$TEMP_DIR")
|
||||||
"$WORKDIR/make-block.pl" --out="$TEMP_BLOCKLIST"
|
"$WORKDIR/make-block.pl" --out="$TEMP_BLOCKLIST"
|
||||||
|
|
||||||
|
# Blocklist generation succeeded, install it!
|
||||||
|
|
||||||
|
if [[ ! -e $BLOCKLIST ]]; then
|
||||||
|
(
|
||||||
|
# First time:
|
||||||
|
# Create an empty blocklist with -rw-r--r-- permissions.
|
||||||
|
# Prevents file not being readable; disregard permissions coming from
|
||||||
|
# whatever file permissions 'mktemp' sets.
|
||||||
|
umask 0022
|
||||||
|
touch -- "$BLOCKLIST"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
replace_with "$BLOCKLIST" "$TEMP_BLOCKLIST"
|
replace_with "$BLOCKLIST" "$TEMP_BLOCKLIST"
|
||||||
|
|
||||||
if [[ ${#DNSMASQ_RESTART_COMMAND[@]} -gt 0 ]]; then
|
if [[ ${#DNSMASQ_RESTART_COMMAND[@]} -gt 0 ]]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue