OutsideIT / FireMotD

:fire: Fire Framework Linux MoTD Generator :fire:
https://outsideit.net/firemotd
GNU General Public License v3.0
175 stars 45 forks source link

Check for write permission of the temp file (e.g. ro filesystem) #77

Open ThomDietrich opened 7 years ago

ThomDietrich commented 7 years ago

One initial action should be a test if the data file can be stored. See: https://community.openhab.org/t/oh2-raspi3-crash-and-lost-config/34916/12

dimon222 commented 7 years ago

Is it about installation makefile or state json file? I mean, if u cant even clone the project (no permission?), its obviously you won't reach the state of checking RW filesystem.

ThomDietrich commented 7 years ago

I'd say these are different shoes. In the particular case the ro filesystem was configured after the initial setup. I would argue, that there are many reasons why a certain file can not be written at some point in the operation time of a system.

I suggest to add a routine to check the ability to write to the given file when starting the script. wdyt?

dimon222 commented 7 years ago

Sure, we can do it at the beginning of script or before export https://github.com/willemdh/FireMotD/blob/master/FireMotD#L693

Or maybe even same as check of sudo? https://github.com/willemdh/FireMotD/blob/master/FireMotD#L1534

PS: if sudo is assumed, then no point to check?!