Seeing "chmod 777" raises alarm bells to me!!
Oh yeah. Don't do that. ( I knew this, but not how fatal it is).
https://superuser.com/questions/300743/sudo-chmod-r-777I think I am OK because I didn't use the -r , recursive, function (I read something once about sticky bits "bricking" a raspeberyy pi; I hope I didn't do that?). But I will change my code. Why did I do it in the first place? I think the piCore wouldn't let me mkdir in root? Maybe I'll just change the U to 7 and leave the G and O alone?
(People out there, reading this; listen to Greg and others. Not me. Unless I said something smart about biology or philosophy or the history of science. Then listen to me.)
*Edit* Maybe, $ chmod 7GO , and then, at the end of the script, $ chmod UGO ; where UGO are the original settings for root on a picore OS. Yeah, that's much better.