Merge branch 'testing' into dev
[feisty_meow.git] / scripts / customize / fred / scripts / cakelampvm / revamp_web_permissions.sh
old mode 100755 (executable)
new mode 100644 (file)
index f474b2d..2948305
@@ -1,42 +1,40 @@
+#!/bin/bash
 
 # fixes the cakelampvm permissions according to the way.
 
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
 ##############
 
-if (( $EUID != 0 )); then
+if [[ $EUID != 0 ]]; then
   echo "This script must be run as root or sudo."
   exit 1
 fi
 
 ##############
 
+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"
+
+##############
+
 # make sure we have the appropriate access on a few key folders.
 normal_perm /var/www
 
 ##############
 
 # change the owner for the web roots to the apache user, www-data.
-sudo chown -R www-data:www-data /var/www
+chown -R www-data:www-data /var/www
 
 # put a couple specific ownerships into play so the appropriate user has full access.
-sudo chown -R developer:developer /home/developer \
-  /etc/apache2 \
-  /etc/bind \
-
-
-sudo chown -R fred:fred        /home/fred \
-  /opt/feistymeow.org \
-  /home/archives/stuffing \
+chown -R developer:developer /home/developer /opt/feistymeow.org /etc/apache2 /etc/bind
 
+chown -R fred:fred /home/fred /home/archives/stuffing 
 
 ##############
 
 # these directories will be given group permissons that enable web server access.
-group_perm /var/www/html \
-  /opt/feistymeow.org \
-  /etc/apache \
-  /
+group_perm /var/www /etc/apache2 /etc/bind
 
 ##############
+