Skip to content

Possible unwanted code and scripts #68

@CDuffers

Description

@CDuffers

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions