From 8335a2b1bafbeb682221e21d3683e84950f15990 Mon Sep 17 00:00:00 2001 From: David Dollar Date: Thu, 16 Aug 2012 12:57:22 -0400 Subject: [PATCH] read .profile, not .profile.d --- bin/foreman-runner | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/foreman-runner b/bin/foreman-runner index cf518a7..9fef811 100755 --- a/bin/foreman-runner +++ b/bin/foreman-runner @@ -16,12 +16,12 @@ usage() { exit } -read_profiled="" +read_profile="" while getopts ":hd:p" OPT; do case $OPT in d) cd "$OPTARG" ;; - p) read_profiled="1" ;; + p) read_profile="1" ;; h) usage ;; \?) error "invalid option: -$OPTARG" ;; :) error "option -$OPTARG requires an argument" ;; @@ -32,13 +32,10 @@ shift $((OPTIND-1)) [ -z "$1" ] && usage -if [ "$read_profiled" == "1" ]; then - shopt -s nullglob - for script in .profile.d/*; do - echo "sourcing $script" - source $script - done - shopt -u nullglob +if [ "$read_profile" == "1" ]; then + if [ -f .profile ]; then + source .profile + fi fi exec "$@"