Add two more selections to threads and redo script writing to flash.

This commit is contained in:
dlandon
2025-01-08 10:06:27 -06:00
parent 3c333bd886
commit d188a8a08a
2 changed files with 4 additions and 27 deletions

View File

@@ -67,6 +67,8 @@ _(Number of Threads)_:
<?=mk_option($rpc_nfsd_count, "8", "8");?>
<?=mk_option($rpc_nfsd_count, "16", "16");?>
<?=mk_option($rpc_nfsd_count, "32", "32");?>
<?=mk_option($rpc_nfsd_count, "64", "64");?>
<?=mk_option($rpc_nfsd_count, "128", "128");?>
</select>
:nfs_threads_help:

View File

@@ -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"