#!/usr/bin/with-contenv bash set -e cp -f /hostscripts/torrent_mqtt.py /config/ cp -f /hostscripts/torrent_qbittorrent_complete.sh /config/ chmod +x /config/torrent_qbittorrent_complete.sh if ! command -v scp >/dev/null 2>&1; then echo "Install scp" for i in {1..12}; do if apk add --no-cache openssh-client; then break fi echo "Retry $i/12" sleep 5 done fi if [ ! -d /config/.venv ]; then echo "Generate venv" python3 -m venv /config/.venv /config/.venv/bin/pip install --upgrade pip /config/.venv/bin/pip install paho-mqtt fi chmod 700 /config/.ssh chmod 600 /config/.ssh/id_ed25519 chmod 644 /config/.ssh/id_ed25519.pub