diff --git a/scripts/install b/scripts/install index 9428a4c..4ba1830 100644 --- a/scripts/install +++ b/scripts/install @@ -14,6 +14,16 @@ fi # Check depends installation sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev -y +# Check Swap +if [ $(swapon -s | wc -l) = 1 ]; +then + sudo dd if=/dev/zero of=/tmp/myswapfile bs=1M count=1024 + sudo chmod 600 /tmp/myswapfile + sudo mkswap /tmp/myswapfile + sudo swapon /tmp/myswapfile +fi + + # Init virtualenv if [ ! -d /opt/searx ]; then @@ -23,6 +33,13 @@ sudo cp -r ../sources/* /opt/searx sudo virtualenv /opt/searx sudo bash -c "source /opt/searx/bin/activate && pip install -r /opt/searx/requirements.txt" +# Disable swapfile +if [ -f /tmp/myswapfile ]; +then + sudo swapoff /tmp/myswapfile + sudo rm -f /tmp/myswapfile +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