home · contact · privacy
Fix.
[config] / buster / setup_scripts / restore_app.sh
index 363a5f6edb4c859d7e81532ee317322b3a1fc270..b5bef5a9d6370c494ec4b8035ea980c053de411a 100755 (executable)
@@ -12,17 +12,21 @@ if [ ! "$1" = "pleroma_otp" ] && [ ! "$1" = "pleroma_sourc" ] && [ ! "$1" = "pee
 fi
 app="$1"
 db_name="$2"
+service="$1"
+if [ "${app}" = "pleroma_source" || "${app}" = "pleroma_otp" ]; then
+    service=pleroma
+fi
 
-service "${app}" stop
+service "${service}" stop
 
-mv "/home/plom/${app}_backup.tar" /tmp/
+mv "/home/plom/${service}_backup.tar" /tmp/
 cd /tmp
-tar xf "${app}_backup.tar"
+tar xf "${service}_backup.tar"
 
-su postgres -c "pg_restore -c -1 -d ${db_name} ${app}_backup/${db_name}.pgdump"
+su postgres -c "pg_restore -c -1 -d ${db_name} ${service}_backup/${db_name}.pgdump"
 rm "${app}_backup/${db_name}.pgdump"
 
-cd "${app}_backup"
+cd "${service}_backup"
 for path in $(find . -type f); do
     if [ "${app}" = "pleroma_source" ]; then
         if [ "${path}" = '/opt/pleroma/config/prod.secret.exs' ]; then
@@ -44,4 +48,4 @@ elif [ "${app}" = "peertube" ]; then
 fi
 su postgres -lc "psql -c \"ALTER USER ${app} WITH PASSWORD '${db_pw}';\""
 
-service "${app}" start
+service "${service}" start