diff --git a/debian/docs/koha-sitemap.xml b/debian/docs/koha-sitemap.xml new file mode 100644 index 0000000000..4f7acbcf4d --- /dev/null +++ b/debian/docs/koha-sitemap.xml @@ -0,0 +1,92 @@ +
+koha-sitemap + +Koha is the first free software library automation package. + + The Koha community + http://koha-community.org/ + + + + + + + koha-sitemap + 8 + + + + koha-sitemap + Manage sitemaps for Koha instances. + UNIX/Linux + + + + + koha-sitemap + + | + | + | + | + || + + instancename + + + + Options + + + + + + + Enable sitemap generation for the desired Koha instances. + + + + + + + Disable sitemap generation for the desired Koha instances. + + + + + + + Generate sitemap for the desired Koha instances. + + + + + + + Make the script quiet about non existent instance names or missing directories. Useful when calling koha-sitemap from another scripts. + + + + + + + Show usage information. + + + + + + + Description + The koha-sitemap script lets you manage your Koha instances sitemaps. + + + See also + + /etc/default/koha-common + + + + + +
diff --git a/debian/koha-common.install b/debian/koha-common.install index 6c2025c04d..270a54a7c9 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -29,6 +29,7 @@ debian/scripts/koha-restart-zebra usr/sbin debian/scripts/koha-restore usr/sbin debian/scripts/koha-run-backups usr/sbin debian/scripts/koha-shell usr/sbin +debian/scripts/koha-sitemap usr/sbin debian/scripts/koha-start-zebra usr/sbin debian/scripts/koha-stop-zebra usr/sbin debian/scripts/koha-translate usr/sbin diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh index 1c309fc4d1..cf6835d8ad 100755 --- a/debian/scripts/koha-functions.sh +++ b/debian/scripts/koha-functions.sh @@ -146,6 +146,17 @@ is_sip_enabled() fi } +is_sitemap_enabled() +{ + local instancename=$1 + + if [ -e /var/lib/koha/$instancename/sitemap.enabled ]; then + return 0 + else + return 1 + fi +} + is_zebra_running() { local instancename=$1 diff --git a/debian/scripts/koha-sitemap b/debian/scripts/koha-sitemap new file mode 100755 index 0000000000..c42ab345a6 --- /dev/null +++ b/debian/scripts/koha-sitemap @@ -0,0 +1,208 @@ +#!/bin/bash +# +# Copyright 2016 Theke Solutions +# +# This file is part of Koha. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -e + +. /lib/lsb/init-functions + +# Read configuration variable file if it is present +[ -r /etc/default/koha-common ] && . /etc/default/koha-common + +# 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 + +usage() +{ + local scriptname=$(basename $0) + + cat <&2 <= 2.4> + AliasMatch "^/sitemap(.*)" "/var/lib/koha/${instance}/sitemap/sitemap$1" + + Require all granted + +