Fix blank $PATH_TO_MISP

Move  PATH_TO_MISP=${PATH_TO_MISP:-$(locate MISP/app/webroot/index.php|sed 's/\/app\/webroot\/index\.php//')} outside of if statement checking if manual input is required otherwise is only executed if locate is unable to determine path.
pull/4416/head
tom564 2019-04-03 20:56:35 +01:00 committed by GitHub
parent fcca264eb7
commit bd652c5c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -127,11 +127,11 @@ if [[ -z $PATH_TO_MISP ]]; then
if [[ "$(locate > /dev/null 2> /dev/null ; echo $?)" != "127" ]]; then
if [[ "$(locate MISP/app/webroot/index.php |wc -l)" > 1 ]]; then
echo "We located more then 1 MISP/app/webroot, reverting to manual"
PATH_TO_MISP=${PATH_TO_MISP:-$(locate MISP/app/webroot/index.php|sed 's/\/app\/webroot\/index\.php//')}
echo -n 'Please enter the base path of your MISP install (e.g /var/www/MISP): '
read PATH_TO_MISP
space
fi
PATH_TO_MISP=${PATH_TO_MISP:-$(locate MISP/app/webroot/index.php|sed 's/\/app\/webroot\/index\.php//')}
fi
fi