Bug 16749: Add is_instance check to koha-upgrade-schema
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 16 Feb 2017 14:07:05 +0000 (14:07 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Feb 2017 13:20:58 +0000 (13:20 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
debian/scripts/koha-upgrade-schema

index c1cc6cb..da50d41 100755 (executable)
@@ -39,8 +39,12 @@ fi
 
 for name in "$@"
 do
-    echo "Upgrading database schema for $name"
-    KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
-    PERL5LIB=$PERL5LIB \
-    "$CGI_PATH/installer/data/mysql/updatedatabase.pl"
+    if is_instance $name; then
+        echo "Upgrading database schema for $name"
+        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
+        PERL5LIB=$PERL5LIB \
+        "$CGI_PATH/installer/data/mysql/updatedatabase.pl"
+    else
+        die "Error: Invalid instance name $name"
+    fi
 done