Can now be installed to /opt and run as a openrc service
This commit is contained in:
32
install.sh
Executable file
32
install.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/env sh
|
||||
|
||||
dyfi_dir=$(dirname "$(realpath "$0")")
|
||||
install_dir='/opt/dyfi/'
|
||||
|
||||
|
||||
sudo -- sh -c "\
|
||||
alias 'cp'='cp --verbose'; \
|
||||
alias 'mkdir'='mkdir --verbose'; \
|
||||
|
||||
cd "$dyfi_dir"; \
|
||||
|
||||
mkdir -p /opt/dyfi; \
|
||||
cp ./auth "$install_dir"; \
|
||||
cp ./dyfi.py "$install_dir"; \
|
||||
cp ./run.sh "$install_dir"; \
|
||||
cp ./requirements.txt "$install_dir"; \
|
||||
cp ./dyfi-openrc.sh /etc/init.d/dyfi; \
|
||||
|
||||
cd "$install_dir"; \
|
||||
|
||||
python -m venv ./venv; \
|
||||
source ./venv/bin/activate; \
|
||||
python -m ensurepip; \
|
||||
pip install --upgrade pip; \
|
||||
pip install -r ./requirements.txt; \
|
||||
"
|
||||
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
./uninstall.sh
|
||||
fi
|
||||
Reference in New Issue
Block a user