diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index bb2b642082..b0c418c1bc 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -163,7 +163,7 @@ opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN" intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN" -if [ `cat $PASSWDFILE | grep "^$name:"` ] +if [ -f $PASSWDFILE ] && [ `cat $PASSWDFILE | grep "^$name:"` ] then passwdline=`cat $PASSWDFILE | grep "^$name:"` mysqluser=`echo $passwdline | cut -d ":" -f 2` @@ -221,11 +221,15 @@ then # Generate Zebra database password. zebrapwd="$(pwgen -s 12 1)" + # Future enhancement: make this configurable for when your db is on + # another server. + mysql_hostname="localhost" # Set up MySQL database for this instance. if [ "$op" = create ] then mysql --defaults-extra-file=/etc/mysql/koha-common.cnf < /dev/null && deluser --quiet "$name-koha" # in case the site has already been disabled, we don't want to break the loop now. - a2dissite "$name" | /bin/true + a2dissite "$name" || /bin/true done service apache2 restart