#!/bin/bash # # vhost-stack # https://git.stack-source.com/msb/vhost-stack # Copyright (c) 2022 Matthew Saunders Brown # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # load include file source $(dirname $0)/vhost.sh help() { thisfilename=$(basename -- "$0") echo "Disable Apache config for specified virtualhost." echo "" echo "usage: $thisfilename -d " echo "" echo " -h Print this help." echo " -d Domain name of VirtualHost to remove." exit } vhost:getoptions "$@" # check for domain (virtualhost) if [[ -z $domain ]]; then echo "domain is required" exit fi if [[ -h /etc/apache2/sites-enabled/$domain.conf ]]; then a2dissite --quiet $domain && systemctl --quiet is-active apache2 && systemctl --quiet reload apache2 fi