Browse Source

[config] réecriture de pre-exec (la création de /var/run en tmpfs est dans read-only-fs.sh)

Maxime Alves LIRMM@home 3 years ago
parent
commit
453c3f5761
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      config/pre-exec.sh

+ 8
- 4
config/pre-exec.sh View File

@@ -1,7 +1,11 @@
1 1
 #!/bin/sh
2 2
 
3
-mkdir /mnt/db
4
-mount -t ramfs -o size=50m ramfs /mnt/db
3
+[ ! -d /opt/pyheatpump/ ] && echo "Missing /opt/pyheatpump/" && exit 1;
5 4
 
6
-mv /var/run/pyheatpump/pyheatpump.sqlite3 /mnt/db
7
-ln -s /mnt/db/pyheatpump.sqlite3 /var/run/pyheatpump/
5
+[ ! -d /var/run/pyheatpump ] && mkdir /var/run/pyheatpump;
6
+
7
+sqlite3 -init /opt/pyheatpump/pyheatpump.sql /var/run/pyheatpump/pyheatpump.sqlite3 \
8
+    || (echo "Failed to initialize database" && exit 1);
9
+
10
+cp /opt/pyheatpump/pyheatpump.ini /var/run/pyheatpump/pyheatpump.ini \
11
+    || (echo "Failed to initialized configuration file" && exit 1);

Loading…
Cancel
Save