#!/usr/bin/env bash sed -i "s/Listen 80/Listen ${PORT:-80}/g" /etc/apache2/ports.conf sed -i "s/:80/:${PORT:-80}/g" /etc/apache2/sites-enabled/* /etc/init.d/mariadb start apache2-foreground
info at phpclasses dot org