Combining help service install into a script.

This commit is contained in:
Roland 2023-11-23 15:49:01 -07:00
parent 844bc9468c
commit a7805745ab
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 24 additions and 16 deletions

View file

@ -47,10 +47,7 @@ sed -i 's/port = 5433/port = 5432/' /etc/postgresql/15/main/postgresql.conf
mkdir /media/wrolpi
# Install WROLPi Help.
git clone https://github.com/wrolpi/wrolpi-help.git /opt/wrolpi-help || :
(cd /opt/wrolpi-help && git fetch && git checkout master && git reset --hard origin/master)
python3 -m venv /opt/wrolpi-help/venv
/opt/wrolpi-help/venv/bin/pip3 install -r /opt/wrolpi-help/requirements.txt
/opt/wrolpi/scripts/install_help_service.sh
cp /opt/wrolpi/etc/raspberrypios/wrolpi-*.service /etc/systemd/system/
cp /opt/wrolpi/etc/raspberrypios/wrolpi.target /etc/systemd/system/

View file

@ -55,10 +55,7 @@ usermod -aG _renderd wrolpi
chown -R _renderd:_renderd /var/cache/renderd/tiles
# Install WROLPi Help.
git clone https://github.com/wrolpi/wrolpi-help.git /opt/wrolpi-help || :
(cd /opt/wrolpi-help && git fetch && git checkout master && git reset --hard origin/master)
python3 -m venv /opt/wrolpi-help/venv
/opt/wrolpi-help/venv/bin/pip3 install -r /opt/wrolpi-help/requirements.txt
/opt/wrolpi/scripts/install_help_service.sh
# Create the media directory for the wrolpi user.
echo '/dev/sda1 /media/wrolpi auto defaults,nofail 0 0' | tee -a /etc/fstab

View file

@ -39,10 +39,7 @@ if [[ ! -f /opt/wrolpi-blobs/gis-map.dump.gz || ! -s /opt/wrolpi-blobs/gis-map.d
fi
# Install WROLPi Help.
git clone https://github.com/wrolpi/wrolpi-help.git /opt/wrolpi-help || :
(cd /opt/wrolpi-help && git fetch && git checkout master && git reset --hard origin/master)
python3 -m venv /opt/wrolpi-help/venv
/opt/wrolpi-help/venv/bin/pip3 install -r /opt/wrolpi-help/requirements.txt
/opt/wrolpi/scripts/install_help_service.sh
# Repair will install configs and restart services.
/opt/wrolpi/repair.sh

20
scripts/install_help_service.sh Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Re-execute this script if it wasn't called with sudo.
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
set -x
set -e
# Install WROLPi Help repo.
git clone https://github.com/wrolpi/wrolpi-help.git /opt/wrolpi-help || :
(cd /opt/wrolpi-help && git fetch && git checkout master && git reset --hard origin/master)
python3 -m venv /opt/wrolpi-help/venv
/opt/wrolpi-help/venv/bin/pip3 install -r /opt/wrolpi-help/requirements.txt
# Install the systemd service.
cp /opt/wrolpi/etc/raspberrypios/wrolpi-help.service /etc/systemd/system/
systemctl enable wrolpi-help.service

View file

@ -39,10 +39,7 @@ if [[ ! -f /opt/wrolpi-blobs/gis-map.dump.gz || ! -s /opt/wrolpi-blobs/gis-map.d
fi
# Install WROLPi Help.
git clone https://github.com/wrolpi/wrolpi-help.git /opt/wrolpi-help || :
(cd /opt/wrolpi-help && git fetch && git checkout master && git reset --hard origin/master)
python3 -m venv /opt/wrolpi-help/venv
/opt/wrolpi-help/venv/bin/pip3 install -r /opt/wrolpi-help/requirements.txt
/opt/wrolpi/scripts/install_help_service.sh
# Repair will install configs and restart services.
/opt/wrolpi/repair.sh