add a bash function ufw_allow which calls 'ufw allow' but hides its totally useless output
This commit is contained in:
parent
66269f910f
commit
e413680f62
5 changed files with 12 additions and 7 deletions
|
@ -43,5 +43,5 @@ chown -R $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/dns
|
||||||
|
|
||||||
# Permit DNS queries on TCP/UDP in the firewall.
|
# Permit DNS queries on TCP/UDP in the firewall.
|
||||||
|
|
||||||
ufw allow domain
|
ufw_allow domain
|
||||||
|
|
||||||
|
|
|
@ -19,3 +19,8 @@ function apt_install {
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -qq -y install $PACKAGES > /dev/null;
|
DEBIAN_FRONTEND=noninteractive apt-get -qq -y install $PACKAGES > /dev/null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ufw_allow {
|
||||||
|
# ufw has completely unhelpful output
|
||||||
|
ufw allow $1 > /dev/null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ service postfix restart
|
||||||
service dovecot restart
|
service dovecot restart
|
||||||
|
|
||||||
# Allow mail-related ports in the firewall.
|
# Allow mail-related ports in the firewall.
|
||||||
ufw allow smtp
|
ufw_allow smtp
|
||||||
ufw allow submission
|
ufw_allow submission
|
||||||
ufw allow imaps
|
ufw_allow imaps
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,6 @@ apt_install ntp fail2ban
|
||||||
# Turn on the firewall. First allow incoming SSH, then turn on the firewall.
|
# Turn on the firewall. First allow incoming SSH, then turn on the firewall.
|
||||||
# Other ports will be opened at the point where we set up those services.
|
# Other ports will be opened at the point where we set up those services.
|
||||||
apt_install ufw
|
apt_install ufw
|
||||||
ufw allow ssh;
|
ufw_allow ssh;
|
||||||
ufw --force enable;
|
ufw --force enable;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,6 @@ service nginx restart
|
||||||
service php-fastcgi restart
|
service php-fastcgi restart
|
||||||
|
|
||||||
# Open ports.
|
# Open ports.
|
||||||
ufw allow http
|
ufw_allow http
|
||||||
ufw allow https
|
ufw_allow https
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue