From 4808a5b08e7dcb7c42ddb3e7595e8282b1c4eeb1 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 27 Nov 2013 20:05:30 -0500 Subject: [PATCH] nice improvement, to move out the custom script so it can be run properly by root. more sudo usage seems slightly safer. --- customizing/fred/fred_common.alias | 2 +- customizing/fred/refred.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 customizing/fred/refred.sh diff --git a/customizing/fred/fred_common.alias b/customizing/fred/fred_common.alias index c0997d66..ea832f20 100644 --- a/customizing/fred/fred_common.alias +++ b/customizing/fred/fred_common.alias @@ -7,7 +7,7 @@ alias moo='check_mount /z/stuffing ; check_mount /z/walrus ; check_mount /z/chun alias unmoo='umount /z/stuffing ; umount /z/walrus ; umount /z/chunky ; umount /z/fredgrid' # cleans up the ownership for all my files. -alias refred='(chown -R fred:fred /home/fred /home/games /home/archives ; normal_perm /var/log )' +#moved alias refred='(chown -R fred:fred /home/fred /home/games /home/archives ; normal_perm /var/log )' # load in the xsede build scripts. source "$FEISTY_MEOW_SCRIPTS/buildor/build_xsedes.sh" diff --git a/customizing/fred/refred.sh b/customizing/fred/refred.sh new file mode 100644 index 00000000..72579923 --- /dev/null +++ b/customizing/fred/refred.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# cleans up the ownership for all my files. +function refred() +{ + chown -R fred:fred /home/fred /home/games /home/archives + bash $FEISTY_MEOW_SCRIPTS/files/normal_perm.sh /var/log +} + +# this block should execute when the script is actually run, rather +# than when it's just being sourced. +if [[ $0 =~ .*refred\.sh.* ]]; then + THISDIR="$( \cd "$(\dirname "$0")" && \pwd )" + export LIGHTWEIGHT_INIT=true + source "$THISDIR/../../scripts/core/launch_feisty_meow.sh" + refred +fi + -- 2.34.1