ednl wrote:All right, here's some meta-feedback
despite being a total Mac-head I loathe the use of the term "simply" … Almost always redundant and often inappropriate because totally subjective.
Sorry, I guess you'll have to simply get used to it / ignore it
Also, why didn't you post the code and readme here on the forum instead of on Github? (I know, version control.) The extra click probably cost you readers.
People are really that lazy?
Maybe I'll edit the first post to provide a bit more detail.
Other than that, the script seems quite handy
Too bad it needs a reboot; is there absolutely no way to avoid that? Maybe killing/starting/restarting certain processes?
I don't think so - the reboot is necessary so that the kernel will re-read cmdline.txt and then not run a serial console on /dev/ttyAMA0. If the serial console could
be killed without requiring a kernel reboot, it would make it fairly useless as a debugging device (which is what the serial console is traditionally used for).
- Test for $(whoami) == "root" instead of relying on $EUID.
Does that make much difference? I always thought that testing for an effective
id was better than testing for an actual
- Sometimes case is easier to use and/or read than if statements.
I tend to save 'case' for when I have an 'if/elif/elif/else' block, and I've not got any 'elif's in this code.
- What if the .bak files already exist? Maybe try something like "i=1; while (exist file.$i.bak) ++i" (pseudo code)
If .bak files already exist, then I assume they're already backups of the original files. I didn't do something like you suggested, because I did something similar before (on an entirely unrelated project) and the user never deleted the backup files, so I ended up with files like filename.21.bak (!)
- The /boot/cmdline.txt edit seems a bit convoluted, might want to look into sed substitution to do it in one line. But hey, it works.
Exactly, "it works"
And the solution I've used is probably more "accurate" than a simple sed would be.
Thanks for your comments.
Just made a small tweak to the script so that error messages get printed to STDERR instead of STDOUT.