reversed polarity, so now FEISTY_MEOW_REPOS_SCAN
[feisty_meow.git] / scripts / system / remove_apache_site.sh
1 #!/bin/bash
2
3 # uninstalls the apache website for a specified domain.
4
5 # auto-find the scripts, since we might want to run this as sudo.
6 export THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
7 export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
8
9 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
10 source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
11
12 # some convenient defaults for our current usage.
13
14 if [ -z "$BASE_APPLICATION_PATH" ]; then
15   BASE_APPLICATION_PATH="$FEISTY_MEOW_REPOS_SCAN"
16 #hmmm: take just first item!
17 fi
18 if [ -z "$STORAGE_SUFFIX" ]; then
19   STORAGE_SUFFIX="/public"
20 fi
21
22 # main body of script.
23
24 if [[ $EUID != 0 ]]; then
25   echo "This script must be run as root or sudo."
26   exit 1
27 fi
28
29 site="$1"; shift
30
31 if [ -z "$site" ]; then
32 #hmmm: move to a print_instructions function.
33   echo "
34 $(basename $0): {dns name} 
35
36 This script needs to know (1) the DNS name for the apache virtual host.
37 The script will uninstall that site's configuration files for apache2.
38 "
39   exit 1
40 fi
41
42 disable_site "$site"
43 remove_apache_config "$site"
44 restart_apache
45