Cyclenerd / static_status

🚦Bash script to generate a static status page.
https://cyclenerd.github.io/static_status/
GNU General Public License v3.0
536 stars 71 forks source link

Wrong "MY_STATUS_CONFIG_DIR" #51

Closed plegrand1 closed 2 years ago

plegrand1 commented 2 years ago

since last update i've got an error when i launch status. $HOME/Documents/Utils/static_status/status.sh using config from file: /home/pascal/Documents/Utils/static_status/config

/home/pascal/Documents/Utils/static_status/status.sh: ligne 221: /home/pascal/status/status_hostname_degrade.txt: Aucun fichier ou dossier de ce type FAILURE: Can not create file '/home/pascal/status/status_hostname_degrade.txt'

It try to create a file in the " /home/pascal/status/" directory but as you can see the good directory is " /home/pascal/Documents/Utils/static_status/

Thanks for your help

Cyclenerd commented 2 years ago

Please check if MY_HOSTNAME_STATUS_DEGRADE is set after MY_STATUS_CONFIG_DIR. I have also updated the example: https://github.com/Cyclenerd/static_status/commit/65be044b9a6b0e55ef25d0ed18a5f676ee381ff8

plegrand1 commented 2 years ago

For information, i didnt touch to the "config" file after update "status.sh" Just download "status.sh".

Then, instead of adding "MY_HOSTNAME_STATUS_DEGRADE" just after MY_STATUS_CONFIG_DIR. I added it as you suggest in the example "config" file between MY_HOSTNAME_STATUS_LASTRUN and MY_HOSTNAME_STATUS_HISTORY

Is it OK ?

Cyclenerd commented 2 years ago

Let me know. Is the variable read as you expected and the file saved at the configured location?

plegrand1 commented 2 years ago

Once the modification is made in the "config" file: .../... MY_HOSTNAME_STATUS_LASTRUN="$MY_STATUS_CONFIG_DIR/status_hostname_last.txt" MY_HOSTNAME_STATUS_DEGRADE="$MY_STATUS_CONFIG_DIR/status_hostname_degrade.txt" MY_HOSTNAME_STATUS_HISTORY="$MY_STATUS_CONFIG_DIR/status_hostname_history.txt" .../...

Everything seems to work and the file "status_hostname_degrade.txt" is created where it should be

Thanks for your help !

Cyclenerd commented 2 years ago

👍