summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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