Merge pull request #244 from Contribution-Tracking/shell

Refactor shell scripts
This commit is contained in:
caryoscelus 2023-11-30 14:40:28 +00:00 committed by GitHub
commit 28a3c4d95c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 12 deletions

View file

@ -1,8 +1,11 @@
#! /usr/bin/env bash #!/usr/bin/env bash
if [ ! -f venv/bin/activate ] ; then VENVPATH="venv/bin/activate"
if [ ! -f "$VENVPATH" ]; then
python3 -m venv venv python3 -m venv venv
fi fi
source venv/bin/activate
source "$VENVPATH"
python3 -m pip install -r requirements.txt python3 -m pip install -r requirements.txt
python3 zeronet.py $1 $2 $3 $4 $5 $6 $7 $8 $9 python3 zeronet.py "$@"

View file

@ -1,12 +1,13 @@
#!/usr/bin/env bash
# Script for running zeronet-conservancy in Termux on Android # Script for running zeronet-conservancy in Termux on Android
if [[ -d zeronet-conservancy ]]; then REPO_DIR="zeronet-conservancy"
cd zeronet-conservancy VENV_SCRIPT="start-venv.sh"
git pull --ff-only
if [[ -d "$REPO_DIR" ]]; then
(cd "$REPO_DIR" && git pull --ff-only)
else else
git clone https://github.com/zeronet-conservancy/zeronet-conservancy git clone https://github.com/zeronet-conservancy/zeronet-conservancy "$REPO_DIR"
cd zeronet-conservancy
fi fi
pkg update -y pkg update -y
@ -16,5 +17,4 @@ echo "Starting tor..."
tor --ControlPort 9051 --CookieAuthentication 1 >/dev/null & tor --ControlPort 9051 --CookieAuthentication 1 >/dev/null &
echo "Starting zeronet-conservancy..." echo "Starting zeronet-conservancy..."
./start-venv.sh (cd "$REPO_DIR" && ./"$VENV_SCRIPT")
cd ..