mirror of
https://github.com/unraid/webgui.git
synced 2026-02-20 08:09:23 -06:00
Add two more selections to threads and redo script writing to flash.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user