'Is there opposite of -y option for 'newrelic'?

I am making a .sh script that will automatically install New Relic's agent on Linux. During installation, there is a prompt if I want to use some extra features, but I don't want them, and I am not sure how can I write a script that will decline that part.

Command:

sudo NEW_RELIC_API_KEY=____NEW_RELIC_ACCOUNT_ID=___ NEW_RELIC_REGION=EU /usr/local/bin/newrelic install

If I add -y after install, it will accept everything, but I wanna the opposite thing.

You can see an example in the screenshot. enter image description here



Solution 1:[1]

No there is no opposite for -y

Solution 2:[2]

Specify a "Recipe" or build your own using the open install library.

For Example: I was able to use this example ubuntu.yml file to run the install command silently (no prompts) on an ubuntu system.

sudo NEW_RELIC_API_KEY=<MY_APIKEY_HERE> NEW_RELIC_ACCOUNT_ID=<MY_NRACCOUNTID_HERE> newrelic install --localRecipes ~/PATH_TO_LOCAL_RECIPE/ubuntu.yml

The key parts of the ubuntu.yml are as follows:

install:
  version: "3"
  silent: true

  tasks:
    default:
      cmds:
      #  - task: assert_pre_req
      #  - task: cleanup
        - task: setup_license
      #  - task: setup_proxy
      #  - task: update_apt
      #  - task: install_gnupg
      #  - task: add_gpg_key
      #  - task: add_nr_source
      #  - task: update_apt_nr_source
        - task: install_infra
        - task: restart
      #  - task: assert_agent_started
      #  - task: assert_agent_status_ok

Note: since I had newrelic infra source/gpg I am able to skip these parts of the recipe.

*Edited to add example.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 HIT POT
Solution 2