X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcustomize%2Ffred%2Frefred.sh;h=2f00854a2c675b44ff9738dd50460cae6de3571b;hb=f63ace5a19fa84c8daf669684ac189575d1eb25b;hp=a220364279a4c001776d29ff945cc8ca51bd34a3;hpb=0b875367bb5da08dec2d1978b484fb884fe39ca6;p=feisty_meow.git diff --git a/scripts/customize/fred/refred.sh b/scripts/customize/fred/refred.sh index a2203642..2f00854a 100644 --- a/scripts/customize/fred/refred.sh +++ b/scripts/customize/fred/refred.sh @@ -1,5 +1,7 @@ #!/bin/bash +#source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + # cleans up the ownership for all my files and dirs. function refred() { @@ -13,14 +15,32 @@ function refred() done #echo arch addin now is: $arch_addin + # special case that makes our software hierarchy folder, if it doesn't exist. + # everything else is only re-permed if it exists. + if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then + sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR" + fi + # 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 + for dirname in /home/fred $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/fred /home/games $arch_addin; do if [ -d "$dirname" ]; then echo "refred on '$dirname'" sudo chown -R fred:fred $dirname fi done + # special case for archives directory. + if [ -d /z/stuffing -o -L /z/stuffing ]; then + sudo chown fred:fred /z; sudo chmod g+rx,o+rx /z + sudo chown fred:fred /z/stuffing; sudo chmod g+rx,o-rwx /z/stuffing + pushd /z/stuffing &>/dev/null + if [ -d archives -o -L archives ]; then + sudo chown fred:fred archives + sudo chmod -R g+rwx archives + fi + popd &>/dev/null + fi + # make the logs readable by normal humans. sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log }