Read MAC adresses and passwords from an extra file

Hi everybody,

here’s my issue:

I have an OpenHAB2 installation on an RaspberryPi. For backup and versioning reasons i want to save the complete /etc/openhab2 directory in an private git repository on github. Of course I don’t want to have my MAC-adresses and passwords (for example for my fritzbox) which are used in some of my openhab2-Files on gitHub. My idea is, to have one file containing all this sensible informations and which is .gitignored.

How can I import variables (like MACs or passwords) from this file into other .things, .services oder .item files? Or is this a bad idea at all?

Thanks for help for a beginner.

Max

Welcome to the Community!

Not sure about the github options but you can use sudo openhab-cli backup --full and move the zipped file to a safe place.

To restore the backup:

Place the backup zip file into the backups folder 
then,
sudo systemctl stop openhab2.service
openhab-cli restore /path/to/zipped/backup (var/lib/openhab2/backups)
sudo systemctl start openhab2.service

This will backup /etc/openhab2/ and /var/lib/openhab2/
This way, the information about installed addons is backuped, but not the addons itself, so when installing openhab2 new, the actual version of the bindings will be installed.
The only things to backup in addition, are the manually installed addons.

1 Like

If it is an encrypted zip file that would provide an extra level of protection.