parent
5a889d8fc6
commit
34da66600d
@ -27,21 +27,23 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ "${RELEASE}" != "$(cat ~/.autobrr 2>/dev/null)" ]] || [[ ! -f ~/.autobrr ]]; then
|
||||
msg_info "Stopping ${APP} LXC"
|
||||
systemctl stop autobrr.service
|
||||
systemctl stop autobrr
|
||||
msg_ok "Stopped ${APP} LXC"
|
||||
|
||||
msg_info "Updating ${APP} LXC"
|
||||
rm -rf /usr/local/bin/*
|
||||
curl -fsSL "$(curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)" -o $(basename "$(curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)")
|
||||
tar -C /usr/local/bin -xzf autobrr*.tar.gz
|
||||
rm -rf autobrr*.tar.gz
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
fetch_and_deploy_gh_release "autobrr" "autobrr/autobrr" "prebuild" "latest" "/usr/local/bin" "autobrr_*_linux_x86_64.tar.gz"
|
||||
|
||||
msg_info "Starting ${APP} LXC"
|
||||
systemctl start autobrr.service
|
||||
systemctl start autobrr
|
||||
msg_ok "Started ${APP} LXC"
|
||||
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,9 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Autobrr"
|
||||
curl -fsSL "$(curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)" -o $(basename "$(curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep download | grep linux_x86_64 | cut -d\" -f4)")
|
||||
tar -C /usr/local/bin -xzf autobrr*.tar.gz
|
||||
rm -rf autobrr*.tar.gz
|
||||
fetch_and_deploy_gh_release "autobrr" "autobrr/autobrr" "prebuild" "latest" "/usr/local/bin" "autobrr_*_linux_x86_64.tar.gz"
|
||||
|
||||
msg_info "Configuring Autobrr"
|
||||
mkdir -p /root/.config/autobrr
|
||||
cat <<EOF >>/root/.config/autobrr/config.toml
|
||||
# https://autobrr.com/configuration/autobrr
|
||||
@ -25,21 +24,24 @@ port = 7474
|
||||
logLevel = "DEBUG"
|
||||
sessionSecret = "$(openssl rand -base64 24)"
|
||||
EOF
|
||||
msg_ok "Installed Autobrr"
|
||||
msg_ok "Configured Autobrr"
|
||||
|
||||
msg_info "Creating Service"
|
||||
service_path="/etc/systemd/system/autobrr.service"
|
||||
echo "[Unit]
|
||||
cat <<EOF >/etc/systemd/system/autobrr.service
|
||||
[Unit]
|
||||
Description=autobrr service
|
||||
After=syslog.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
ExecStart=/usr/local/bin/autobrr --config=/root/.config/autobrr/
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >$service_path
|
||||
systemctl enable --now -q autobrr.service
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable --now -q autobrr
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
|
Loading…
x
Reference in New Issue
Block a user