#!/bin/bash
set -e
if (( `id -u` != 0)); then
echo Run this as root.
exit
fi
echo Updating packages:
apt-get -qq update
apt-get -qq install curl python3 python3-pip --yes
echo Fetching files:
dir="/tmp/nvdaremote"
mkdir "$dir"&&cd "$dir"
pre="https://raw.githubusercontent.com/NVDARemote/remote-server/master"
curl -O "$pre/requirements.txt" -O "$pre/server.py" -O "https://get.nvra.io/nvdaremote.service"
echo Installing python requirements:
pip3 install --break-system-packages -qr requirements.txt
echo Setting up:
mkdir /var/remote-server
groupadd nvda
useradd -g nvda -d /var/remote-server nvda
cp server.py /var/remote-server/
cp nvdaremote.service /lib/systemd/system/
cd /var/remote-server/
openssl req -newkey rsa:4096 -keyout privkey -nodes -x509 -days 3650 -out cert -outform PEM -subj "/C=US"
cp cert chain
chmod 600 /var/remote-server/*
chown -R nvda:nvda /var/remote-server
systemctl enable nvdaremote.service
systemctl start nvdaremote.service
echo All done! The NVDA remote server is: `systemctl is-active nvdaremote.service`
cd ~
rm -rf "$dir"