Skip to content

Instantly share code, notes, and snippets.

@eliaskousk
Last active May 12, 2016 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliaskousk/74e4ed51f815e92a91a76d2b62b623ee to your computer and use it in GitHub Desktop.
Save eliaskousk/74e4ed51f815e92a91a76d2b62b623ee to your computer and use it in GitHub Desktop.
Check virtualbox install
#!/bin/bash
INSTALL_VIRTUALBOX=1
VBOX_PKG=virtualbox
VBOX_CHECK=$(dpkg-query -W --showformat='${Status}\n' virtualbox virtualbox-5.0 \
2>/dev/null | awk '{print $3;}' | grep "installed")
if [ "$VBOX_CHECK" != "" ]; then
echo "Virtualbox is already installed"
INSTALL_VIRTUALBOX=0
VBOX_PKG=
fi
# ...
sudo apt-get install $VBOX_PKG ansible nfs-kernel-server curl
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment