From ded11a5faba29349263139f51a62e1285a174aa7 Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Wed, 8 Jan 2025 11:19:22 -0800 Subject: [PATCH] nfssettings script tweaks --- emhttp/plugins/dynamix/scripts/nfsSettings | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/emhttp/plugins/dynamix/scripts/nfsSettings b/emhttp/plugins/dynamix/scripts/nfsSettings index 218396e56..e0db64442 100755 --- a/emhttp/plugins/dynamix/scripts/nfsSettings +++ b/emhttp/plugins/dynamix/scripts/nfsSettings @@ -4,8 +4,8 @@ # apply() { - echo "RPC_NFSD_VERS=\"$RPC_NFSD_VERS\"" > $CONFIG - echo "RPC_NFSD_COUNT=\"$RPC_NFSD_COUNT\"" >> $CONFIG + echo "RPC_NFSD_VERS=\"$RPC_NFSD_VERS\"" > $CONFIG_RAM + echo "RPC_NFSD_COUNT=\"$RPC_NFSD_COUNT\"" >> $CONFIG_RAM } nfs_version() { @@ -16,16 +16,17 @@ nfs_count() { echo $RPC_NFSD_COUNT } -# Path to the configuration file -CONFIG="/boot/config/default/nfs" +# Path to the configuration files +CONFIG_ROM="/etc/default/nfs" +CONFIG_RAM="/boot/config/default/nfs" -# Get the values from the file -source "$CONFIG" +# Get current settings +source "$CONFIG_ROM" case "$1" in 'apply') - RPC_NFSD_VERS="$2" - RPC_NFSD_COUNT="$3" + [[ -n $2 ]] && RPC_NFSD_VERS="$2" + [[ -n $3 ]] && RPC_NFSD_COUNT="$3" apply ;; 'nfs_version')