3 #source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
5 # cleans up the ownership for all my files and dirs.
8 # first build a list of dirs based on their location in /home/archives.
9 local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus"
10 local ARCHIVE_HOME=/home/archives
13 for dirname in $arch_builder; do
14 arch_addin+="$ARCHIVE_HOME/$dirname "
16 #echo arch addin now is: $arch_addin
18 # special case that makes our software hierarchy folder, if it doesn't exist.
19 # everything else is only re-permed if it exists.
20 if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
21 sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
24 # iterate across the list of dirs we want fred to own and change their ownership.
25 for dirname in /home/fred $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/fred /home/games $arch_addin; do
26 if [ -d "$dirname" ]; then
27 echo "refred on '$dirname'"
28 sudo chown -R fred:fred $dirname
32 # special case for archives directory.
33 if [ -d /z/stuffing -o -L /z/stuffing ]; then
34 sudo chown fred:fred /z; sudo chmod g+rx,o+rx /z
35 sudo chown fred:fred /z/stuffing; sudo chmod g+rx,o-rwx /z/stuffing
36 pushd /z/stuffing &>/dev/null
37 if [ -d archives -o -L archives ]; then
38 sudo chown fred:fred archives
39 sudo chmod -R g+rwx archives
44 # make the logs readable by normal humans.
45 sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
48 # this block should execute when the script is actually run, rather
49 # than when it's just being sourced.
50 if [[ $0 =~ .*refred\.sh.* ]]; then
51 THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
52 source "$THISDIR/../../core/launch_feisty_meow.sh"