1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-11 16:57:23 +01:00

rename the scripts directory to setup

This commit is contained in:
Joshua Tauberer
2014-06-03 11:12:38 +00:00
parent af03feb389
commit da15ae5375
14 changed files with 21 additions and 21 deletions

28
setup/functions.sh Normal file
View File

@@ -0,0 +1,28 @@
function apt_install {
# Report any packages already installed.
PACKAGES=$@
TO_INSTALL=""
for pkg in $PACKAGES; do
if dpkg -s $pkg 2>/dev/null | grep "^Status: install ok installed" > /dev/null; then
echo $pkg is already installed \(`dpkg -s $pkg | grep ^Version: | sed -e "s/.*: //"`\)
else
TO_INSTALL="$TO_INSTALL""$pkg "
fi
done
# List the packages about to be installed.
if [[ ! -z "$TO_INSTALL" ]]; then
echo installing $TO_INSTALL...
fi
# 'DEBIAN_FRONTEND=noninteractive' is to prevent dbconfig-common from asking you questions.
DEBIAN_FRONTEND=noninteractive apt-get -qq -y install $PACKAGES > /dev/null;
}
function ufw_allow {
if [ -z "$DISABLE_FIREWALL" ]; then
# ufw has completely unhelpful output
ufw allow $1 > /dev/null;
fi
}