diff options
author | Senthil Kumaran S <senthil.kumaran@linaro.org> | 2018-02-05 19:38:14 +0530 |
---|---|---|
committer | Senthil Kumaran S <senthil.kumaran@linaro.org> | 2018-02-05 19:38:14 +0530 |
commit | f0239e1f56f850b18e84463c9c8f79df7a63a96c (patch) | |
tree | e96601b37f08a64a48fee3ebc795109a3bd24aa9 | |
parent | f9fcf344fe27e2a81c1bee04801c0dfe8885260a (diff) |
Change-Id: I8171f31e4808d2cccba0b5fae1b60b484e94dc4d
-rwxr-xr-x | lxc-create | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -17,6 +17,9 @@ PACKAGES=$(sed 's/,/ /g' <<< $(cut -d' ' -f1 <<< $(awk -F'--packages ' '{print $ while getopts "qt:n:" opt; do case $opt in + q) + QUIET=1 + ;; n) LXC_NAME="$OPTARG" ;; @@ -25,11 +28,16 @@ while getopts "qt:n:" opt; do esac done -if [ "$PACKAGES" ]; then - apt update - apt upgrade -y +if [ "$PACKAGES" ] && [ "$QUIET" ]; then + DEBIAN_FRONTEND=noninteractive apt update > /dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive apt upgrade -y > /dev/null 2>&1 + # install the requested packages. + DEBIAN_FRONTEND=noninteractive apt install -y $PACKAGES > /dev/null 2>&1 +elif [ "$PACKAGES" ]; then + DEBIAN_FRONTEND=noninteractive apt update + DEBIAN_FRONTEND=noninteractive apt upgrade -y # install the requested packages. - apt install -y $PACKAGES + DEBIAN_FRONTEND=noninteractive apt install -y $PACKAGES fi if [ "$LXC_NAME" ]; then |