#!/bin/bash

ENABLE_DEBUG="s/debug : False/debug : True/g"
DISABLE_DEBUG="s/debug : True/debug : False/g"
SETTINGS_FILE="/etc/searxng/settings.yml"

#???????????????????
DEBUG=$DISABLE_DEBUG
#???????????????????

# enable/disable debug mode
sudo -H sed -i -e {$DEBUG} {$SETTINGS_FILE}

# start webapp
#sudo -H -u searxng -i
PATH=/usr/local/searxng/searxng-src:$PATH
#cd /usr/local/searxng/searxng-src
export SEARXNG_SETTINGS_PATH={$SETTINGS_FILE}
python /usr/local/searxng/searxng-src/searx/webapp.py


