summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/scripts/dbus-send.sh
diff options
context:
space:
mode:
authorMeghana M <mmadhusu@redhat.com>2015-06-19 05:48:05 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-24 03:27:19 -0700
commit1ff820381b33b65c54d5e7019a670b9dc1cc6844 (patch)
treed65f10024cee6039847651edaf59f48f08a8d2ea /extras/ganesha/scripts/dbus-send.sh
parent21f2719bf4c43ae6712f41d23de11b5854a019f2 (diff)
NFS-Ganesha : Implement refresh-config
It is important that we give an automatic way of refreshing the config when the user has changed the export file manually. Without this, the user will be forced to restart the server. Implementing refresh_config by utilizing two other scripts that are already in place. Making a few changes to make sure that "--help" doesn't throw unnecessary error messages. Change-Id: I6559b89e858526717168ba286e1ff7d9977097c6 BUG: 1233624 Signed-off-by: Meghana M <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/11331 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras/ganesha/scripts/dbus-send.sh')
-rwxr-xr-xextras/ganesha/scripts/dbus-send.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/extras/ganesha/scripts/dbus-send.sh b/extras/ganesha/scripts/dbus-send.sh
index 170983a7a77..b96bba90e45 100755
--- a/extras/ganesha/scripts/dbus-send.sh
+++ b/extras/ganesha/scripts/dbus-send.sh
@@ -4,14 +4,16 @@ declare -i EXPORT_ID
GANESHA_DIR=${1%/}
OPTION=$2
VOL=$3
-
-CONF=$(cat /etc/sysconfig/ganesha | grep "CONFFILE" | cut -f 2 -d "=")
+cfgline=$(grep ^CONFFILE= /etc/sysconfig/ganesha)
+eval $(echo ${cfgline} | grep -F CONFFILE=)
+CONF=${CONFFILE:-/etc/ganesha/ganesha.conf}
function check_cmd_status()
{
if [ "$1" != "0" ]
then
rm -rf $GANESHA_DIR/exports/export.$VOL.conf
+ sed -i /$VOL.conf/d $CONF
exit 1
fi
}
@@ -20,7 +22,7 @@ function check_cmd_status()
function dynamic_export_add()
{
count=`ls -l $GANESHA_DIR/exports/*.conf | wc -l`
- if [ "$count" = "1" ] ;
+ if [ "$count" = "0" ] ;
then
EXPORT_ID=2
else