From 0b875367bb5da08dec2d1978b484fb884fe39ca6 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 1 Nov 2017 19:28:41 -0400 Subject: [PATCH] tasty cleanings made an archives builder for the home archives folder. a lot easier to maintain now. --- scripts/customize/fred/refred.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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 } -- 2.34.1