From e365dabf452cc87f7166fea4fe1c8dcc903bccc3 Mon Sep 17 00:00:00 2001 From: Neil Mayhew Date: Thu, 8 May 2014 11:26:35 +0200 Subject: Use $0 for BASEDIR instead of $HOME To: Joerg Jaspert Cc: Neil Mayhew Date: Fri, 22 Jun 2012 11:27:58 -0600 (1 year, 45 weeks, 4 days ago) From: Neil Mayhew Ths provides more flexibility in where the scripts are placed, without having to specify BASEDIR in the command --- bin/ftpsync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ftpsync b/bin/ftpsync index 780245b..a8826bc 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -28,10 +28,10 @@ set -E # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # In case the admin somehow wants to have this script located someplace else, -# he can set BASEDIR, and we will take that. If it is unset we take ${HOME} +# he can set BASEDIR, and we will take that. If it is unset we use $0 # How the admin sets this isn't our place to deal with. One could use a wrapper # for that. Or pam_env. Or whatever fits in the local setup. :) -BASEDIR=${BASEDIR:-"${HOME}"} +BASEDIR=${BASEDIR:-"$(readlink -f $(dirname "$0")/..)"} # Script version. DO NOT CHANGE, *unless* you change the master copy maintained # by Joerg Jaspert and the Debian mirroradm group. -- cgit v1.2.3