X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsystem%2Fadd_domain.sh;h=e6b97fb6660fda2371481e1f05742872001f8ee1;hb=60c2f55a575288b5148ed8c530b720d2576cbc48;hp=0dabaf2e7b4234392fe214883a4fdd6c3e07e94b;hpb=7b39f7e279005c8466ef508220a532ce2aa4abf8;p=feisty_meow.git diff --git a/scripts/system/add_domain.sh b/scripts/system/add_domain.sh index 0dabaf2e..e6b97fb6 100644 --- a/scripts/system/add_domain.sh +++ b/scripts/system/add_domain.sh @@ -8,13 +8,19 @@ # # Author: Chris Koeritz +export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. +export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )" + +source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh" + # some defaults that are convenient for current purposes. -# hmmm: these would need to be parameterized somehow for this script to become really general. + +# hmmm: !!! these would need to be parameterized somehow for this script to become really general. # in our scheme, the single IP address that all our domains map to. IP_ADDRESS="10.28.42.20" # the email address (where first dot is replaced by @) for the administrator of the domain. -SERVER_ADMIN="fred.cakelampvm.com" +SERVER_ADMIN="developer.cakelampvm.com" # the name of the name server for the new domains (should already be configured). MAIN_NAME_SERVER="ns.cakelampvm.com" # the name of the mail server for a new domain (should already be configured). @@ -33,11 +39,13 @@ function write_new_domain_file() echo "using the config file: $domain_file" if [ -f $domain_file ]; then + echo echo "The domain configuration file already exists at:" echo " $domain_file" - echo "Please remove this file before proceeding, if it is junk. For example:" - echo " sudo rm $domain_file" - exit 1 + echo "Since we don't want to tear that down if it has specialized configuration" + echo "data in it, we will just leave it in place and consider our job done." + echo + exit 0 fi echo " @@ -130,7 +138,7 @@ function restart_bind() # main body of script. -if (( $EUID != 0 )); then +if [[ $EUID != 0 ]]; then echo "This script must be run as root or sudo." exit 1 fi