From 2bde98155876bc09c8996ce701e14528eab44059 Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Tue, 7 Jul 2015 13:06:36 +1200 Subject: [PATCH] Bug 13143 - Detect if the password is in a pipe 1. cd kohaclone/debian/scripts 2. sudo koha-passwd instance | cat Output should be password only 3. sudo koha-passwd instance Output should be "Password for $instance is: $password" Does this get at what you were wanting, Robin? NOTE: $ cd ~ $ sudo mkdir /etc/koha $ sudo mkdir /etc/koha/sites $ sudo mkdir /etc/koha/sites/library $ sudo ln -s ~/koha-dev/etc/koha-conf.xml /etc/koha/sites/library/koha-conf.xml $ sudo mkdir /usr/share/koha $ sudo ln -s ~/kohaclone/debian/scripts /usr/share/koha/bin This will fake out your system enough to get koha-passwd to run in your git system. Since you are using your git system, no need for the sudo's in steps 2 & 3. And no need to roll a custom build to test it. Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart --- debian/scripts/koha-passwd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/debian/scripts/koha-passwd b/debian/scripts/koha-passwd index b9faa02..5be04b4 100755 --- a/debian/scripts/koha-passwd +++ b/debian/scripts/koha-passwd @@ -45,11 +45,15 @@ EOF for name in "$@" do if is_instance $name ; then - passwd=$(xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/$name/koha-conf.xml); - echo "Password for $name: $passwd" - echo "Press enter to clear the screen..." - read anykey - clear + passwd=$(xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/$name/koha-conf.xml); + if [ -t 1 ]; then + echo "Password for $name: $passwd" + echo "Press enter to clear the screen..." + read anykey + clear + else + echo "$passwd" + fi else warn "Unknown instance $name." fi -- 2.1.0