Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emonhub.conf is not always imported correctly #67

Open
borpin opened this issue Feb 14, 2023 · 1 comment
Open

Emonhub.conf is not always imported correctly #67

borpin opened this issue Feb 14, 2023 · 1 comment

Comments

@borpin
Copy link
Contributor

borpin commented Feb 14, 2023

backup/usb-import.sh

Lines 217 to 227 in 9cfc5b8

# Copy emonhub conf
# ---------------------------------------------------------------
# New structure
if [ -f /media/old_sd_root/etc/emonhub/emonhub.conf ]; then
sudo cp -fv /media/old_sd_root/etc/emonhub/emonhub.conf $emonhub_config_path/emonhub.conf
fi
# Old structure
if [ -f /media/old_sd_data/emonhub.conf ]; then
sudo cp -fv /media/old_sd_data/emonhub.conf $emonhub_config_path/emonhub.conf
fi
# ---------------------------------------------------------------

From a number of queries in the community, I suspect that emonhub.conf i not always imported correctly.

Because there are 2 ifs it is possible that the one in use, could be overwritten by a very old version.

Compress to a single if and save the default version. Bias towards the new structure configuration

borpin added a commit to borpin/backup that referenced this issue Feb 14, 2023
re emoncms#67 

Decided to import both if found as it will be unknown which is correct.

Both could possibly be found from a previous import/update I feel.

It may be possible to determine which is the correct one to use if both have been imported.

Happy for a critique on this :)
@TrystanLea
Copy link
Member

Hopefully this should fix this: 4740b57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants