Projet de remplacement du "RPiPasserelle" d'Otec.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pre-exec.sh 782B

12345678910111213141516171819
  1. #!/bin/sh
  2. # If directory exists don't run the script
  3. # cd /opt/pyheatpump git clone https://git.yannweb.net/cli/pyHeatpump.git
  4. [ ! -d /opt/pyHeatpump/ ] && echo "Missing /opt/pyHeatpump/" && exit 1;
  5. [ ! -d /run/pyheatpump/ ] && echo "Missing /run/pyheatpump/" && exit 1;
  6. [ -f /run/pyheatpump/pyheatpump.sqlite3 ] && [ -f /run/pyheatpump/pyheatpump.ini ] \
  7. && echo "Incorrect runtime directory" && exit 1;
  8. # Database initialization
  9. sqlite3 -init /opt/pyHeatpump/db/pyheatpump.sql /run/pyheatpump/pyheatpump.sqlite3 .quit \
  10. || (echo "Failed to initialize database" && exit 1);
  11. # Default configuration setup
  12. cp /opt/pyHeatpump/config/pyheatpump.prod.ini.dist /run/pyheatpump/pyheatpump.ini \
  13. || (echo "Failed to initialized configuration file" && exit 1);
  14. exit 0;