Many times before I have needed to "clean up" the "
custom_clientlist" NVRAM variable because after some client devices are no longer in use (replaced or simply no longer work) the webGUI does not show them, but the old entries were still in NVRAM. This has happened with several ASUS router models (from relatives & friends) that I have helped with maintenance over the years, so I created a custom shell script that I've used many times to delete the obsolete or unwanted entries from the "custom_clientlist" variable.
I have updated this script to be able to modify/replace the client names if you so choose. I also added more error handling and user-friendly messages so it's a bit easier to use.
This script is now available on GitHub:
Bash:
mkdir -m 755 -p /jffs/scripts
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused https://raw.githubusercontent.com/Martinski4GitHub/CustomMiscUtils/master/nvramCustomClientList.sh -o /jffs/scripts/nvramCustomClientList.sh
chmod 755 /jffs/scripts/nvramCustomClientList.sh
The steps that I've used before to delete obsolete entries from "
custom_clientlist" are the following:
1) First, make a backup of the current original value (to have it available just in case a restore is necessary or wanted later on):
Bash:
./nvramCustomClientList.sh backup
2) Now, show the current value that lists all the client entries:
Bash:
./nvramCustomClientList.sh show
3) Select the obsolete/unwanted "
ClientName" from the available entries shown in step
2, and execute the command to simply test/check/verify the deletion changes:
Bash:
./nvramCustomClientList.sh modify "ClientName" -DELETE-
4) If the results of the temporary changes shown in step
3 are good and everything looks valid & correct, you can now make the change permanent by committing it with the following command:
Bash:
./nvramCustomClientList.sh docommit modify "ClientName" -DELETE-
5) "Rinse & Repeat" steps
2 thru
4 for any other "ClientName" entries you want to delete.
If for some reason you want to go back to the original NVRAM value, you can still restore it with the following command:
Bash:
./nvramCustomClientList.sh restore
However, when you're happy with the final changes and want to remove all temporary files & the backup, use the following command:
Bash:
./nvramCustomClientList.sh doclear
To modify/replace an existing "
OldClientName" with "
NewClientName" string you can use the same exact steps as listed above but with a modified parameter.
To check/test/verify changes:
Bash:
./nvramCustomClientList.sh modify "OldClientName" "NewClientName"
To commit changes after you're happy with the results above:
Bash:
./nvramCustomClientList.sh docommit modify "OldClientName" "NewClientName"
CAVEAT:
The script currently does not check for valid chars used in "
NewClientName" string so it's up to you to use valid chars:
alphanumeric,
hyphen (-),
underscore (_) &
period (.) are the ones I prefer to use. Anything else may or may not work.
HTH.