diff --git a/seqs/pyload.sh b/seqs/pyload.sh new file mode 100755 index 0000000..58b3bc3 --- /dev/null +++ b/seqs/pyload.sh @@ -0,0 +1,71 @@ +#!/bin/bash +toolName="pyload" +toolUser="${toolName}" +toolBranch="stable" +toolDownload="https://github.com/pyload/pyload.git" +toolDeps="git liblept5 python python-crypto python-pycurl python-imaging tesseract-ocr zip unzip python-openssl libmozjs-24-bin" +toolBuildDeps="rar unrar-nonfree" + +step_1_info() { echo "Apt sources.list check and update"; } +step_1_alias() { ALIAS="install"; } +step_1() { + echo "Make sure you have the \"deb-src\" entry active in your /etc/apt/sources.list" + echo "Especially check for \"non-free\"" + exe read -p "Press Enter to continue: " + exe vi /etc/apt/sources.list + exe apt update +} + +step_2_info() { echo "Install dependencies $toolDeps $toolBuildDeps"; } +step_2() { + exe apt-get install ${toolDeps} + exe apt-get build-dep ${toolBuildDeps} + saveReturn $? + endReturn + cd /usr/bin + exe ln -s js24 js + cd /tmp + exe apt-get source -b unrar-nonfree + saveReturn $? + endReturn + exe dpkg -i unrar_*_armhf.deb + exe rm -rf unrar-* +} + +step_3_info() { echo "Get $toolName from $toolDownload and create dedicated user"; } +step_3() { + cd /opt + exe git clone -b $toolBranch $toolDownload + saveReturn $? + endReturn + exe adduser --system "$toolUser" +} + +step_4_info() { echo "Make initial configuration"; } +step_4() { + echo "Webinterface server \"threaded\" is recommended on a raspberry pi." + exe read -p "Press Enter to continue: " + cd /opt/pyload + exe sudo -u $toolUser python pyLoadCore.py +} + +step_5_info() { echo "Create systemd service"; } +step_5() { + addConf -c "$toolService" "$toolServiceLoc" +} + +toolServiceLoc="/etc/systemd/system/pyload.service" +toolService="\ +[Unit] +Description=Python Downloader +After=network.target + +[Service] +User=pyload +ExecStart=/usr/bin/python /opt/pyload/pyLoadCore.py + +[Install] +WantedBy=multi-user.target" + +VERSION_SEQREV=5 +. sequencer.sh