Skip to content

Commit

Permalink
v6.23
Browse files Browse the repository at this point in the history
+ DietPi-Pre-patch | Apply new G_CHECK_URL settings to dietpi.txt. Required in pre-patches since those values are used throughout patch_file already.
  • Loading branch information
MichaIng authored Apr 22, 2019
1 parent 645c9d3 commit d299e3d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions dietpi/pre-patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@
fi
#-------------------------------------------------------------------------------
# Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656
if (( $G_DIETPI_VERSION_SUB < 23 )) && [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then
# Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings
if (( $G_DIETPI_VERSION_SUB < 23 )); then

echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades but allow auto-upgrades for WireGuard packages'
echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n
if [[ -f /etc/apt/preferences.d/dietpi-wireguard ]]; then

echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades but allow auto-upgrades for WireGuard packages'
echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n
Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard || { EXIT_CODE=4; break; }

fi

grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; }
grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; }

fi
#-------------------------------------------------------------------------------
# Finished
Expand Down

0 comments on commit d299e3d

Please sign in to comment.