diff --git a/CHANGELOG.md b/CHANGELOG.md index d20ef582..08b14548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to ### Fixed +- Inaccurate using of service actions in the installation script ([#3450]). - Client ID checking ([#3437]). - Discovering other DHCP servers on `darwin` and `freebsd` ([#3417]). - Switching listening address to unspecified one when bound to a single @@ -126,6 +127,7 @@ and this project adheres to [#3417]: https://github.com/AdguardTeam/AdGuardHome/issues/3417 [#3435]: https://github.com/AdguardTeam/AdGuardHome/issues/3435 [#3437]: https://github.com/AdguardTeam/AdGuardHome/issues/3437 +[#3450]: https://github.com/AdguardTeam/AdGuardHome/issues/3450 diff --git a/scripts/install.sh b/scripts/install.sh index c1b290d2..3fa62cfd 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -474,10 +474,10 @@ handle_existing() { if [ "$reinstall" -ne '1' ] && [ "$uninstall" -ne '1' ] then error_exit \ -"to reinstall/uninstall the AdGuard Home using\this script specify one of the '-r' or '-u' flags" +"to reinstall/uninstall the AdGuard Home using this script specify one of the '-r' or '-u' flags" fi - if ( cd "$agh_dir" && ! ./AdGuardHome -s uninstall ) + if ( cd "$agh_dir" && ! ./AdGuardHome -s stop || ! ./AdGuardHome -s uninstall ) then # It doesn't terminate the script since it is possible # that AGH just not installed as service but appearing @@ -498,9 +498,11 @@ handle_existing() { # Function install_service tries to install AGH as service. install_service() { + # Installing as root is required at least on FreeBSD. + # # TODO(e.burkov): Think about AGH's output suppressing with no verbose # flag. - if ( cd "$agh_dir" && ./AdGuardHome -s install ) + if ( cd "$agh_dir" && $sudo_cmd ./AdGuardHome -s install ) then return 0 fi