Created
October 30, 2013 08:46
-
-
Save MagnusEnger/7229191 to your computer and use it in GitHub Desktop.
This script is based on the commands made available by a package installation of Koha. It takes the name of a syspref as its argument, then prints the value of that syspref for every Koha instance on the server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check that the user is root | |
if [ "$(whoami)" != "root" ]; then | |
echo "Sorry, you are not root." | |
exit 1 | |
fi | |
die() { | |
echo "$@" 1>&2 | |
exit 1 | |
} | |
[ "$#" = 1 ] || die "Usage: $0 sysprefname" | |
for name in $(koha-list); do | |
echo -n "$name: " | |
# Output from this next line is two lines: | |
# - First line is just the string "value" | |
# - Second line is the actual value we are looking for | |
# The sed command gives us just the second line | |
echo "SELECT value FROM systempreferences WHERE variable = '$1'" | sudo koha-mysql $name | sed -n '2 p' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment