summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenthil Kumaran S <senthil.kumaran@linaro.org>2018-02-05 19:38:14 +0530
committerSenthil Kumaran S <senthil.kumaran@linaro.org>2018-02-05 19:38:14 +0530
commitf0239e1f56f850b18e84463c9c8f79df7a63a96c (patch)
treee96601b37f08a64a48fee3ebc795109a3bd24aa9
parentf9fcf344fe27e2a81c1bee04801c0dfe8885260a (diff)
Account for -q in lxc-create command.HEADmaster
Change-Id: I8171f31e4808d2cccba0b5fae1b60b484e94dc4d
-rwxr-xr-xlxc-create16
1 files changed, 12 insertions, 4 deletions
diff --git a/lxc-create b/lxc-create
index cd0e3b8..dc76292 100755
--- a/lxc-create
+++ b/lxc-create
@@ -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