From 2fcdaac56e20f1002ae76c6ae1b30a093452d21b Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Tue, 18 Apr 2017 16:54:12 +0100 Subject: [PATCH] Make a2dissite fail softly if the site is not enabled a2dissite will return a non-zero error code if the site that is being disabled is not currently enabled (that is, if the conf file for it does not exist). This can happen during development if you've been messing with files by hand. Rather than exploding out of a ./stack.sh, accept the missing file as meaning "it's disabled" and carry one. The rpm version of disable, which does not use a2dissite, does this already. Change-Id: Ie5dfd42efdff4bdba5ffaa765af000dd8e1d596e --- lib/apache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apache b/lib/apache index 20700d802f..f88f1d3504 100644 --- a/lib/apache +++ b/lib/apache @@ -186,7 +186,7 @@ function enable_apache_site { function disable_apache_site { local site=$@ if is_ubuntu; then - sudo a2dissite ${site} + sudo a2dissite ${site} || true elif is_fedora || is_suse; then local enabled_site_file="$APACHE_CONF_DIR/${site}.conf" # Do nothing if no site config exists