Browse code

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

Chris Dent authored on 2017/04/19 00:54:12
Showing 1 changed files
... ...
@@ -186,7 +186,7 @@ function enable_apache_site {
186 186
 function disable_apache_site {
187 187
     local site=$@
188 188
     if is_ubuntu; then
189
-        sudo a2dissite ${site}
189
+        sudo a2dissite ${site} || true
190 190
     elif is_fedora || is_suse; then
191 191
         local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
192 192
         # Do nothing if no site config exists