From 5a75542273889a2463f871417383fa3616756dbc Mon Sep 17 00:00:00 2001 From: Frank Alvarado Date: Mon, 10 Jun 2024 22:21:49 -0500 Subject: [PATCH] more changes --- ct/mylar3.sh | 5 +---- install/mylar3-install.sh | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ct/mylar3.sh b/ct/mylar3.sh index 7dcf393c..22378e7b 100644 --- a/ct/mylar3.sh +++ b/ct/mylar3.sh @@ -59,10 +59,7 @@ if [[ ! -d /opt/mylar3 ]]; then msg_error "No ${APP} Installation Found!"; exit; msg_info "Updating $APP" systemctl stop mylar3.service RELEASE=$(curl -s https://api.github.com/repos/mylar3/mylar3/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -tar zxvf <(curl -fsSL https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz) &>/dev/null -RELEASE="${RELEASE:1}" -\cp -r mylar3-${RELEASE}/* /opt/mylar3 &>/dev/null -rm -rf mylar3-${RELEASE} +tar zxvf <(curl -fsSL https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz) -C /opt/mylar3 cd /opt/mylar3 python3 -m pip install -r requirements.txt &>/dev/null systemctl start mylar3.service diff --git a/install/mylar3-install.sh b/install/mylar3-install.sh index 6e7b9c84..94aacc7b 100644 --- a/install/mylar3-install.sh +++ b/install/mylar3-install.sh @@ -37,25 +37,27 @@ msg_ok "Updated Python3" msg_info "Installing Mylar3" RELEASE=$(curl -s https://api.github.com/repos/mylar3/mylar3/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -$STD tar zxvf <(curl -fsSL https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz) -mv mylar3-${RELEASE:1} /opt/mylar3 +msg_info "Installing Mylar3 ${RELEASE} (Patience)" +mkdir -p /opt/mylar3 +tar zxvf <(curl -fsSL https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz) -C /opt/mylar3 --strip-components=1 cd /opt/mylar3 $STD python3 -m pip install -r requirements.txt +echo "${RELEASE:1}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Mylar3" msg_info "Creating Service" -service_path="/etc/systemd/system/mylar3.service" -echo "[Unit] -Description=Mylar3 -After=network.target +cat </etc/systemd/system/mylar3.service +[Unit] +Description=mylar3 + [Service] +Type=simple WorkingDirectory=/opt/mylar3 ExecStart=python3 Mylar.py -p 8585 -Restart=always -User=root [Install] -WantedBy=multi-user.target" >$service_path -systemctl enable --now -q mylar3.service +WantedBy=multi-user.target +EOF +systemctl -q --now enable mylar3 msg_ok "Created Service" motd_ssh @@ -64,4 +66,4 @@ customize msg_info "Cleaning up" $STD apt-get -y autoremove $STD apt-get -y autoclean -msg_ok "Cleaned" +msg_ok "Cleaned" \ No newline at end of file