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

Possible unwanted code and scripts #68

Open
CDuffers opened this issue Feb 26, 2023 · 0 comments
Open

Possible unwanted code and scripts #68

CDuffers opened this issue Feb 26, 2023 · 0 comments

Comments

@CDuffers
Copy link

I'm working on some pull requests for minor tweaks on the import and export shell scripts and noticed the following code which I cannot find being used anywhere:

backup/emoncms-import.sh

Lines 42 to 50 in 9cfc5b8

# Very old images (the ones shipped with kickstarter campaign) have "emonpi-28May2015"
if [[ -z $image_version ]] || [[ "$image_date" == "emonSD-17Jun2015" ]]
then
image="old"
echo "$image image"
else
image="new"
echo "$image image"
fi

It used to work here and was commented out some time ago:

backup/emoncms-import.sh

Lines 156 to 166 in 9cfc5b8

# Start with blank emonhub.conf
# if [[ $image == "old" ]]
# then # Legacy image use emonhub.conf without MQTT authenitication
# echo "Start with fresh config: copy LEGACY default.emonhub.conf:"
# echo "cp $emonhub_specimen_config/old.default.emonhub.conf $emonhub_config_path/emonhub.conf"
# cp $emonhub_specimen_config/old.default.emonhub.conf $emonhub_config_path/emonhub.conf
# else # Newer Feb15+ image use latest emonhub.conf with MQTT node variable topic structure and MQTT authentication enabled
# echo "Start with fresh config: copy NEW default emonpi.emonhub.conf:"
# echo "cp $emonhub_specimen_config/emonpi.default.emonhub.conf $emonhub_config_path/emonhub.conf"
# cp $emonhub_specimen_config/emonpi.default.emonhub.conf $emonhub_config_path/emonhub.conf
# fi

And similar for export it has this code which isn't referenced anywhere:

backup/emoncms-export.sh

Lines 53 to 59 in 9cfc5b8

# Very old images (the ones shipped with kickstarter campaign) have "emonpi-28May2015"
if [[ -z $image_version ]] || [[ "$image_date" == "emonSD-17Jun2015" ]]
then
image="old"
else
image="new"
fi

I propose that these code segments are no longer of use and should be removed to tidy up the scripts a little.

I'm happy to work on pull requests and some testing and wanted to get your thoughts before spending time on it. What do you think?

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

1 participant