# auto-find the scripts, since we might want to run this as sudo.
export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )" # obtain the script's working directory.
-source "$WORKDIR/../core/launch_feisty_meow.sh"
+export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
# some convenient defaults for our current usage.
if [ -f "$site_config" ]; then
echo "The apache configuration file already exists at:"
echo " $site_config"
- echo "Please remove this file before proceeding, if it is junk. For example:"
- echo " sudo rm $site_config"
- exit 1
+ echo "Since apache configuration files can get very complex, we do not want to"
+ echo "assume that this file is removable. Calling the site addition done."
+ exit 0
fi
echo "Creating a new apache2 site for $sitename with config file:"
Include /etc/apache2/conf-library/rewrite-enabling.conf
</VirtualHost>
" >"$site_config"
+
+ chown "$(logname):$(logname)" "$site_config"
+ test_or_die "setting ownership on: $site_config"
}
# turns on the config file we create above for apache.
# 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