From: Chris Koeritz Date: Wed, 1 Nov 2017 23:28:41 +0000 (-0400) Subject: tasty cleanings X-Git-Tag: 2.140.90~119 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=0b875367bb5da08dec2d1978b484fb884fe39ca6;p=feisty_meow.git tasty cleanings made an archives builder for the home archives folder. a lot easier to maintain now. --- diff --git a/scripts/customize/fred/refred.sh b/scripts/customize/fred/refred.sh index f11d8b50..a2203642 100644 --- a/scripts/customize/fred/refred.sh +++ b/scripts/customize/fred/refred.sh @@ -1,9 +1,27 @@ #!/bin/bash -# cleans up the ownership for all my files. +# cleans up the ownership for all my files and dirs. function refred() { - sudo chown -R fred:fred /home/fred /usr/local/fred /home/games /home/archives/stuffing /home/archives/games + # first build a list of dirs based on their location in /home/archives. + local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus" + local ARCHIVE_HOME=/home/archives + local dirname + local arch_addin + for dirname in $arch_builder; do + arch_addin+="$ARCHIVE_HOME/$dirname " + done +#echo arch addin now is: $arch_addin + + # iterate across the list of dirs we want fred to own and change their ownership. + for dirname in /home/fred /usr/local/fred /home/games $arch_addin; do + if [ -d "$dirname" ]; then + echo "refred on '$dirname'" + sudo chown -R fred:fred $dirname + fi + done + + # make the logs readable by normal humans. sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log }