summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/scripts/create-export-ganesha.sh
diff options
context:
space:
mode:
authorJoe Julian <jjulian@io.com>2015-09-08 09:53:54 -0700
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-03-14 21:33:37 -0700
commit6d83559ea42644ed39e21c76cef8a1974f3dcab0 (patch)
treeb6a03ab779f4dadeebd472ed9ed3fec0e4dc8a0e /extras/ganesha/scripts/create-export-ganesha.sh
parent932ef7d760ee7593d337026b2126037105ffe410 (diff)
common-ha: distribution neutral location of config files
work on systems with config files in directories other than /etc/sysconfig. BUG: 1251821 Change-Id: I009946623b508ba422a4881913455218d8846055 Signed-off-by: Joe Julian <me@joejulian.name> Reviewed-on: http://review.gluster.org/12132 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/13723 Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras/ganesha/scripts/create-export-ganesha.sh')
-rwxr-xr-xextras/ganesha/scripts/create-export-ganesha.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/extras/ganesha/scripts/create-export-ganesha.sh b/extras/ganesha/scripts/create-export-ganesha.sh
index ab7c282af79..bd884b4c4a8 100755
--- a/extras/ganesha/scripts/create-export-ganesha.sh
+++ b/extras/ganesha/scripts/create-export-ganesha.sh
@@ -5,10 +5,24 @@
#An export file specific to a volume
#is created in GANESHA_DIR/exports.
+# Try loading the config from any of the distro
+# specific configuration locations
+if [ -f /etc/sysconfig/ganesha ]
+ then
+ . /etc/sysconfig/ganesha
+fi
+if [ -f /etc/conf.d/ganesha ]
+ then
+ . /etc/conf.d/ganesha
+fi
+if [ -f /etc/default/ganesha ]
+ then
+ . /etc/default/ganesha
+fi
+
GANESHA_DIR=${1%/}
VOL=$2
CONF=
-CONFFILE=
function check_cmd_status()
{
@@ -42,14 +56,8 @@ function find_rhel7_conf
done
}
-cfgline=$(grep ^CONFFILE= /etc/sysconfig/ganesha)
-eval $(echo ${cfgline} | grep -F ^CONFFILE=)
-
-if [ -z $CONFFILE ]
- then
- cfgline=$(grep ^OPTIONS= /etc/sysconfig/ganesha)
- eval $(echo ${cfgline} | grep -F ^OPTIONS=)
- find_rhel7_conf $cfgline
+if [ -z $CONFFILE ]; then
+ find_rhel7_conf $OPTIONS
fi
CONF=${CONFFILE:-/etc/ganesha/ganesha.conf}