diff -Nur --no-dereference smeserver-onlyoffice-0.0.5.old/root/etc/e-smith/events/actions/smeserver-onlyoffice-conf smeserver-onlyoffice-0.0.5/root/etc/e-smith/events/actions/smeserver-onlyoffice-conf --- smeserver-onlyoffice-0.0.5.old/root/etc/e-smith/events/actions/smeserver-onlyoffice-conf 2023-02-07 00:32:01.841000000 -0500 +++ smeserver-onlyoffice-0.0.5/root/etc/e-smith/events/actions/smeserver-onlyoffice-conf 2023-02-07 01:36:46.917000000 -0500 @@ -40,16 +40,17 @@ PGUSER=`/sbin/e-smith/config getprop onlyoffice dbuser || echo 'onlyoffice'` PGNAME=`/sbin/e-smith/config getprop onlyoffice dbname || echo 'onlyoffice'` CONNECTION_PARAMS="-hlocalhost -U$PGUSER -w" -PSQL="psql -q $CONNECTION_PARAMS" +psql="/usr/pgsql-13/bin/psql" +PSQL="$psql -q $CONNECTION_PARAMS" CREATEDB="createdb -q $CONNECTION_PARAMS" -su - postgres -c "psql -lqt | cut -d \| -f 1 | grep -q -w $PGNAME" +su - postgres -c "$psql -lqt | cut -d \| -f 1 | grep -q -w $PGNAME" if [ $? -eq 1 ]; then # database do not exists - su - postgres -c "psql -c \"CREATE DATABASE $PGNAME;\"" - su - postgres -c "psql -c \"CREATE USER $PGUSER WITH password '$PGPASSWORD';\"" - su - postgres -c "psql -c \"GRANT ALL privileges ON DATABASE $PGNAME TO $PGUSER;\"" + su - postgres -c "$psql -c \"CREATE DATABASE $PGNAME;\"" + su - postgres -c "$psql -c \"CREATE USER $PGUSER WITH password '$PGPASSWORD';\"" + su - postgres -c "$psql -c \"GRANT ALL privileges ON DATABASE $PGNAME TO $PGUSER;\"" else - su - postgres -c "psql -c \"ALTER USER $PGUSER WITH password '$PGPASSWORD';\"" + su - postgres -c "$psql -c \"ALTER USER $PGUSER WITH password '$PGPASSWORD';\"" fi # check if db works correctly @@ -115,9 +116,9 @@ fi # check if webtop5 db is present to add onlyoffice config and restart webtop -su - postgres -c "psql -lqt | cut -d \| -f 1 | grep -q -w webtop5" +su - postgres -c "$psql -lqt | cut -d \| -f 1 | grep -q -w webtop5" if [ $? -eq 0 ]; then - su - postgres -c "psql webtop5" <