updated release notes for 3.14.0 beta
[koha.git] / debian / scripts / koha-restore
index 560dc40..caf4c7d 100755 (executable)
@@ -54,7 +54,7 @@ name=$(tar tf "$configdump" |
        sed -n '/^etc\/koha\/sites\/\([^/]*\)\/$/s//\1/p')
 username="$name-koha"
 adduser --no-create-home --disabled-login --gecos "Koha instance $username" \
-    --quiet "$username"
+    --home "/var/lib/koha/$name" --quiet "$username"
 
 
 # Create dirs. Some of them will be in the tarball, but not all, e.g.,
@@ -69,7 +69,7 @@ tar -C / -xf "$configdump"
 # Re-create database and database user.
 mysqldb="koha_$name"
 mysqluser="koha_$name"
-mysqlpwd="$(sed -n '/.*<pass>\(.*\)<\/pass>.*/s//\1/p' /etc/koha/sites/$name/koha-conf.xml)"
+mysqlpwd="$( xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/$name/koha-conf.xml )"
 zcat "$sqldump" | mysql --defaults-extra-file=/etc/mysql/koha-common.cnf
 mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof || true
 DROP USER '$mysqluser';