Bug 25618: Fix wrong package install path for misc dir
[koha-ffzg.git] / debian / scripts / koha-restore
index 4999088..e8ec053 100755 (executable)
 
 set -e
 
-
-die() {
-    echo "$@" 1>&2
+# include helper functions
+if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
+    . "/usr/share/koha/bin/koha-functions.sh"
+else
+    echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
     exit 1
-}
-
+fi
 
 # Parse command line.
 [ "$#" = 2 ] || die "Usage: $0 sqldump configdump"
@@ -54,7 +55,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.,