-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da14869
commit 5eb9c69
Showing
1 changed file
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,8 @@ set -e | |
export PATH+=':/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' | ||
|
||
# Basic knot-resolver variables | ||
kresd_deb_url=https://secure.nic.cz/files/knot-resolver/knot-resolver-release.deb | ||
kresd_release_file=/tmp/knot-resolver-release.deb | ||
kresd_apt_list=/etc/apt/sources.list.d/knot-resolver-latest.list | ||
kresd_repo_script_url=https://pkg.labs.nic.cz/doc/scripts/enable-repo-cznic-labs.sh | ||
kresd_repo_script_path=/tmp/enable-repo-cznic-labs.sh | ||
kresd_device=dns0 | ||
kresd_ip=127.0.0.53 | ||
kresd_config_file=/etc/knot-resolver/kresd.conf | ||
|
@@ -81,15 +80,19 @@ echo -e "\nDetected environment: $up_environment \n" | |
ln -sf $up_lib_dir/up-config /usr/local/bin/up-config | ||
ln -sf $up_lib_dir/up-config.functions /usr/local/lib/up-config.functions | ||
|
||
echo -ne "Installing knot-resolver requirements ... \t" | ||
if [ ! -f "$kresd_apt_list" ]; then | ||
curl -s $kresd_deb_url --output $kresd_release_file | ||
dpkg -i $kresd_release_file &>/dev/null | ||
apt-get -qq update | ||
rm $kresd_release_file | ||
echo -ne "Setup knot-resolver repo ... \t" | ||
|
||
# Remove legacy knot-resolver repo | ||
legacy_apt_installed=$(dpkg-query -W --showformat='${db:Status-Status}' knot-resolver-release 2>&1) || status=$? | ||
if [[ "$legacy_apt_installed" == "installed" ]]; then | ||
apt-get remove --purge knot-resolver-release > /dev/null 2>&1 | ||
fi | ||
|
||
apt-get install -qq -y knot-resolver knot-resolver-module-http lua-psl &>/dev/null | ||
curl -sSL "$kresd_repo_script_url" -o "$kresd_repo_script_path" | ||
bash "$kresd_repo_script_path" knot-resolver > /dev/null 2>&1 | ||
|
||
apt-get -qq update &>/dev/null | ||
apt-get -y install knot-resolver knot-resolver-module-http lua-psl &>/dev/null | ||
|
||
if ! nmcli dev show $kresd_device &>/dev/null; then | ||
nmcli connection add type dummy ifname $kresd_device ipv4.method manual ipv4.addresses $kresd_ip/24 &>/dev/null | ||
|
@@ -106,7 +109,6 @@ if ! [ -f "/etc/up.conf" ]; then | |
up_configured=true | ||
fi | ||
|
||
|
||
systemctl enable --now [email protected] &>/dev/null | ||
systemctl enable --now [email protected] &>/dev/null | ||
|
||
|