diff --git a/Vagrantfile b/Vagrantfile index f3bb364..7095c07 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -13,7 +13,7 @@ else git clone --depth 1 https://github.com/named-data/mini-ndn.git pushd mini-ndn fi -./install.sh -a +./install.sh -qa SCRIPT diff --git a/docs/install.rst b/docs/install.rst index 391fdfa..9073622 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -67,6 +67,15 @@ To install without CCL, use: ./install.sh -mni +To install in "quiet" mode (without user interaction), use: + +:: + ./install.sh -qa + +.. note:: + The order of the flag -q is important to ensure that the environment is ready for + a quiet install. + See ``install.sh -h`` for detailed options. Installing Dependencies diff --git a/install.sh b/install.sh index 8a4f903..35071b1 100755 --- a/install.sh +++ b/install.sh @@ -109,6 +109,16 @@ function patchDummy { fi } +function quiet_install { + if [[ $DIST == Ubuntu || $DIST == Debian ]]; then + update='sudo DEBIAN_FRONTEND=noninteractive apt-get update' + install='sudo DEBIAN_FRONTEND=noninteractive apt-get -y install' + remove='sudo DEBIAN_FRONTEND=noninteractive apt-get -y remove' + + echo "wireshark-common wireshark-common/install-setuid boolean false" | sudo debconf-set-selections + fi +} + function ndn_install { mkdir -p $NDN_SRC name=$1 @@ -344,13 +354,14 @@ function usage { printf -- ' -m: install mininet and dependencies\n' >&2 printf -- ' -n: install NDN dependencies of mini-ndn including infoedit\n' >&2 printf -- ' -p: patch ndn-cxx with dummy key chain\n' >&2 + printf -- ' -q: quiet install (must be specified first)\n' >&2 exit 2 } if [[ $# -eq 0 ]]; then usage else - while getopts 'acdhimnp' OPTION + while getopts 'acdhimnpq' OPTION do case $OPTION in a) @@ -367,6 +378,7 @@ else m) mininet;; n) ndn;; p) patchDummy;; + q) quiet_install;; ?) usage;; esac done