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 # iterate across the list of dirs we want fred to own and change their ownership.
19 for dirname in /home/fred /usr/local/fred /home/games $arch_addin; do
20 if [ -d "$dirname" ]; then
21 echo "refred on '$dirname'"
22 sudo chown -R fred:fred $dirname
26 # special case for archives directory.
27 if [ -d /z/stuffing -o -L /z/stuffing ]; then
28 sudo chown fred:fred /z; sudo chmod g+rx,o+rx /z
29 sudo chown fred:fred /z/stuffing; sudo chmod g+rx,o-rwx /z/stuffing
30 pushd /z/stuffing &>/dev/null
31 if [ -d archives -o -L archives ]; then
32 sudo chown fred:fred archives
33 sudo chmod -R g+rwx archives
38 # make the logs readable by normal humans.
39 sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
42 # this block should execute when the script is actually run, rather
43 # than when it's just being sourced.
44 if [[ $0 =~ .*refred\.sh.* ]]; then
45 THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
46 source "$THISDIR/../../core/launch_feisty_meow.sh"