I tried replacing the "* " on line 479 with “1500”. Got an error then for Line 480 but not 479! Changed line 480 to 1500 also but then got the new error in the second screenshot!!!
I changed the 1500 back to * and rebooted. The original error returned. The only temporary fix I was able to find was to open the terminal window, launch dietpi-cloudshell, and tab down to “Start / Restart Apply settings. Launch on Main screen (tty1)” and hit enter. Screen then displays as normal without the error. The error does NOT come back until I need to reboot. I’ve uninstalled cloudshell and reinstalled. Error still persists. Now I’ve gone to github and looked at the original code for v116, v117, and v118. Line 479-480 is exactly the same as it shows at GitHub!
I don’t know much about ODROID - but the syntax error seems like it’s because the left-hand side of the $(( ValueA * ValueB)) is being evaluated as null on reboot, and the error is because Bash is seeing the “*” first - and, well, you will want an operand (packets transferred) before a mathematical expression, as the error says. Think of it as: $(( 5 * 3 )) would be 15, but $(( * 3 )) or $(( * )) makes no sense - and removing the * only confuses the issue.
My gut is that if you’re seeing this on every reboot, the script is running before the eth0 network interface is up - netstat and grepping for “eth0” returns nothing - and so the variable(s) being used in the syntax get assigned to NULL and aren’t getting re-evaluated. But I’m guessing without facts, and would defer to any experts here on the matter.
I tried replacing the "* " on line 479 with “1500”. Got an error then for Line 480 but not 479! Changed line 480 to 1500 also but then got the new error in the second screenshot!!!
Very good debugging, I came to the same tests
My gut is that if you’re seeing this on every reboot, the script is running before the eth0 network interface is up
I think your spot on.
I’ll setup a C2 disable eth0 and modify dietpi-cloudshell source to force use eth0. If it replicates the same error, should be an simple sourcecode fix.
Ok, added a valid integer check, before the scene is updated:
local mtu_size=$(netstat -N -i | grep "$NETWORK_DETAILS_ADAPTER" | awk '{print $2}')
if [[ ! $mtu_size =~ ^-?[0-9]+$ ]]; then
run_update=0
fi
local network_usage_current_recieved=$(netstat -N -i | grep "$NETWORK_DETAILS_ADAPTER" | awk '{print $4}')
if [[ ! $network_usage_current_recieved =~ ^-?[0-9]+$ ]]; then
run_update=0
fi
local network_usage_current_sent=$(netstat -N -i | grep "$NETWORK_DETAILS_ADAPTER" | awk '{print $8}')
if [[ ! $network_usage_current_sent =~ ^-?[0-9]+$ ]]; then
run_update=0
fi
We could probably get away with just checking for one valid integer from scrape (eg: network_usage_current_recieved). But there is no harm in checking all variables used in our calculations have a valid integer, before we use them.
You can install the updated version of DietPi-Cloudshell by running:
It has cycled through a couple of times and no errors show up! I will keep an eye on it for the next 12hrs and post one last update to see how it fairs through the night. I don’t see any further issues with this particular hiccup. This is excellent!!! Thank You
No error, it has not returned! However, a minor item has surfaced. This may need to go into a separate thread. Please let me know.
While I didn’t quite make it to 12hrs due to thunderstorms that have been non-stop for the last 8-9hrs, so I unplugged everything. The one thing I have notice is that the IP address and MAC address will not populate until I have accessed a session through SSH. I noticed that last night and I tested it again this morning when I turned everything back on. I let it set for 90min before accessing SSH. IP and MAC did not populate until I did so. Not an issue for me but a minor bug that could easily be overlooked otherwise.