Skip to content

Commit

Permalink
scripts: add os-specific requirements check
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed May 17, 2021
1 parent 6313d8f commit 0852c87
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,27 @@ is_little_endian() {
# machine. The required software (only one requirement for now):
#
# curl
# unzip (macOS)
# tar (linux)
#
check_required() {
readonly spec_darwin="unzip"
readonly spec_linux="tar"

# Split with space.
readonly required="curl"
required="curl"
if [ "$os" = 'linux' ]
then
required="$required $spec_linux"
elif [ "$os" = 'darwin' ]
then
required="$required $spec_darwin"
fi

# Don't use quotes to get word splitting.
for cmd in ${required}
do
echo "checking $cmd"
if ! is_command "$cmd"
then
log "the full list of required software: [$required]"
Expand Down Expand Up @@ -454,13 +467,12 @@ cpu=''
os=''
out_dir='/opt'
pkg_ext='tar.gz'

parse_opts $*
check_required

echo 'starting AdGuard Home installation script'

configure
check_required

if ! is_root
then
Expand Down

0 comments on commit 0852c87

Please sign in to comment.