The last 2 points above appear to indicate that you likely have installed some Entware packages that include binaries with the same name as the router built-in binaries but behave differently when using the same arguments, and your PATH environment variable is set up to give those Entware binaries priority over their built-in counterparts which would affect running the shell script via an interactive session but not via the WebGUI....
After reboot:
- CLI menu now shows "user7" as the UI page
- Database size still shows partialadminusername+"B"
- user7 works but shows a proper database size
Please run the following commands via an SSH terminal session and post the output:
Bash:
env | grep PATH= ; which sed ; which ls ; which grep