Pull request: 5431 FreeBSD install script
Merge in DNS/adguard-home from 5431-freebsd-install-script to master Updates #5431. Squashed commit of the following: commit a36127e5349bcff572644d0636bbfa91f4a679bb Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Feb 7 15:45:35 2023 +0300 all: imp docs commit c0f2f686c4aa0953345f9c441deddadcd0a3861e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Feb 7 14:20:57 2023 +0300 scripts: add fetch(1) support
This commit is contained in:
@@ -338,6 +338,18 @@ download_wget() {
|
||||
wget --no-verbose -O "$wget_output" "$1"
|
||||
}
|
||||
|
||||
# download_fetch uses fetch(1) to download a file. The first argument is the
|
||||
# URL. The second argument is optional and is the output file.
|
||||
download_fetch() {
|
||||
fetch_output="${2:-}"
|
||||
if [ "$fetch_output" = '' ]
|
||||
then
|
||||
fetch -o '-' "$1"
|
||||
else
|
||||
fetch -o "$fetch_output" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function set_download_func sets the appropriate function for downloading
|
||||
# files.
|
||||
set_download_func() {
|
||||
@@ -348,6 +360,9 @@ set_download_func() {
|
||||
elif is_command 'wget'
|
||||
then
|
||||
download_func='download_wget'
|
||||
elif is_command 'fetch'
|
||||
then
|
||||
download_func='download_fetch'
|
||||
else
|
||||
error_exit "either curl or wget is required to install AdGuard Home via this script"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user