From d188a8a08abb2dcb31e1ad1f80a4ad9264b08bf0 Mon Sep 17 00:00:00 2001 From: dlandon Date: Wed, 8 Jan 2025 10:06:27 -0600 Subject: [PATCH] Add two more selections to threads and redo script writing to flash. --- emhttp/plugins/dynamix/NFS.page | 2 ++ emhttp/plugins/dynamix/scripts/nfsSettings | 29 ++-------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/emhttp/plugins/dynamix/NFS.page b/emhttp/plugins/dynamix/NFS.page index 1f89d6898..d3326e8fc 100644 --- a/emhttp/plugins/dynamix/NFS.page +++ b/emhttp/plugins/dynamix/NFS.page @@ -67,6 +67,8 @@ _(Number of Threads)_: + + :nfs_threads_help: diff --git a/emhttp/plugins/dynamix/scripts/nfsSettings b/emhttp/plugins/dynamix/scripts/nfsSettings index fab91291f..218396e56 100755 --- a/emhttp/plugins/dynamix/scripts/nfsSettings +++ b/emhttp/plugins/dynamix/scripts/nfsSettings @@ -4,17 +4,8 @@ # apply() { - # Modify RPC_NFSD_VERS in the CONFIG file - if grep -q "^RPC_NFSD_VERS=" "$CONFIG"; then - # Update the existing value - sed -i "s/^RPC_NFSD_VERS=.*/RPC_NFSD_VERS=\"$RPC_NFSD_VERS\"/" "$CONFIG" - fi - - # Modify RPC_NFSD_COUNT in the CONFIG file - if grep -q "^RPC_NFSD_COUNT=" "$CONFIG"; then - # Update the existing value - sed -i "s/^RPC_NFSD_COUNT=.*/RPC_NFSD_COUNT=\"$RPC_NFSD_COUNT\"/" "$CONFIG" - fi + echo "RPC_NFSD_VERS=\"$RPC_NFSD_VERS\"" > $CONFIG + echo "RPC_NFSD_COUNT=\"$RPC_NFSD_COUNT\"" >> $CONFIG } nfs_version() { @@ -27,22 +18,6 @@ nfs_count() { # Path to the configuration file CONFIG="/boot/config/default/nfs" -DEFAULT_CONFIG="/etc/default/nfs" - -# Ensure the directory exists -mkdir -p "/boot/default" - -# Make a copy of the configuration on the flash -if [[ ! -f "$CONFIG" ]]; then - # File does not exist, copy the default config - cp "$DEFAULT_CONFIG" "$CONFIG" - - # Set RPC_NFSD_BIND to blank in the copied file - if grep -q "^RPC_NFSD_BIND=" "$CONFIG"; then - # Update the existing value - sed -i 's/^RPC_NFSD_BIND=.*/RPC_NFSD_BIND=""/' "$CONFIG" - fi -fi # Get the values from the file source "$CONFIG"