3 # this performs the inverse operation of standup, by relying on the
4 # remove_domain and remove_apache_site scripts.
6 # Author: Chris Koeritz
8 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.
9 export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
11 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
13 ############################
15 function print_instructions()
18 echo "$(basename $0 .sh) {app name}"
21 $(basename $0 .sh) will drop a web site out of apache server and out of the
22 DNS server, as if it never existed. The site storage is left untouched; we
23 don't know what valuable assets lurk there.
24 This script must be run as sudo or root; it makes changes to system files.
29 ############################
31 # main body of script.
33 # check for parameters.
34 app_dirname="$1"; shift
36 if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
38 elif [ -z "$app_dirname" ]; then
42 # force the sudo at the start of the script, rather than waiting halfway
43 # through to ask for access.
44 sudo bash -c 'echo sudo permissions acquired.'
46 source "$WORKDIR/shared_site_mgr.sh"
50 check_application_dir "$BASE_APPLICATION_PATH"
52 # find proper webroot where the site will be initialized.
53 if [ -z "$app_dirname" ]; then
54 # no dir was passed, so guess it.
55 find_app_folder "$BASE_APPLICATION_PATH"
57 test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
62 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$DOMAIN_NAME"
63 test_or_die "dropping apache site for: $DOMAIN_NAME"
67 #echo "!! domain being removed is: $DOMAIN_NAME"
69 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_domain.sh" "$DOMAIN_NAME"
70 test_or_die "dropping domain: $DOMAIN_NAME"
75 Finished tearing down the domain name and apache site for: