From faf12c7e6fc622f4eca99fdaba6ca3bed304b196 Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 22 Jul 2014 12:04:58 +0200 Subject: [PATCH] [fix] Path in upgrade script. --- scripts/upgrade | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 9044e03..58293be 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,6 +3,9 @@ domain=$(sudo yunohost app setting searx domain) path=$(sudo yunohost app setting searx path) is_public=$(sudo yunohost app setting searx is_public) +# Remove trailing "/" for next commands +path=${path%/} + # Check depends installation sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev -y @@ -32,6 +35,12 @@ then sudo rm -f /tmp/myswapfile fi +# Remove trailing "/" for next commands if installing on a subpath +if [ "$path" != "/" ]; +then + path=${path%/} +fi + #Configuration Searx sudo cp ../conf/settings.yml /opt/searx/searx/ sudo sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" /opt/searx/searx/settings.yml