making some restrictions tighter
[feisty_meow.git] / scripts / customize / fred / scripts / cakelampvm / revamp_web_permissions.sh
old mode 100755 (executable)
new mode 100644 (file)
index f474b2d..837cf3c
@@ -1,42 +1,42 @@
+#!/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
 
 ##############
 
-# make sure we have the appropriate access on a few key folders.
-normal_perm /var/www
-
-##############
+export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../../../../.." && \pwd )"
 
-# change the owner for the web roots to the apache user, www-data.
-sudo chown -R www-data:www-data /var/www
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
-# 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 \
+##############
 
+# fix up the main web storage.
+chown -R www-data:www-data /var/www 
+group_perm /var/www 
 
-sudo chown -R fred:fred        /home/fred \
-  /opt/feistymeow.org \
-  /home/archives/stuffing \
+##############
 
+# set up access on some important folders for the developer user.
+chown -R developer:developer /home/developer /opt/feistymeow.org /etc/apache2 /etc/bind 
+normal_perm /opt/feistymeow.org 
+# don't want others trying to check feisty meow in.
+harsh_perm /opt/feistymeow.org/feisty_meow/.git
+harsh_perm /home/developer/.ssh
+group_perm /etc/apache2 /etc/bind 
 
 ##############
 
-# these directories will be given group permissons that enable web server access.
-group_perm /var/www/html \
-  /opt/feistymeow.org \
-  /etc/apache \
-  /
+# fix perms for fred user.
+chown -R fred:fred /home/fred /home/archives/stuffing 
+harsh_perm /home/fred/.ssh
 
 ##############
+