Refactor (#6823)
This commit is contained in:
parent
723ac08abb
commit
6796e609d0
20
ct/zoraxy.sh
20
ct/zoraxy.sh
@ -27,17 +27,21 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
RELEASE=$(curl -fsSL https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
msg_info "Updating $APP to ${RELEASE}"
|
if [[ ! -f ~/.zoraxy ]] || [[ "${RELEASE}" != "$(cat ~/.zoraxy)" ]]; then
|
||||||
|
msg_info "Stopping service"
|
||||||
systemctl stop zoraxy
|
systemctl stop zoraxy
|
||||||
curl -fsSL "https://github.com/tobychui/zoraxy/releases/download/${RELEASE}/zoraxy_linux_amd64" -o $(basename "https://github.com/tobychui/zoraxy/releases/download/${RELEASE}/zoraxy_linux_amd64")
|
msg_ok "Service stopped"
|
||||||
|
|
||||||
rm -rf /opt/zoraxy/zoraxy
|
rm -rf /opt/zoraxy/zoraxy
|
||||||
mv zoraxy_linux_amd64 /opt/zoraxy/zoraxy
|
fetch_and_deploy_gh_release "zoraxy" "tobychui/zoraxy" "singlefile" "latest" "/opt/zoraxy" "zoraxy_linux_amd64"
|
||||||
chmod +x /opt/zoraxy/zoraxy
|
|
||||||
|
msg_info "Starting service"
|
||||||
systemctl start zoraxy
|
systemctl start zoraxy
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
msg_ok "Service started"
|
||||||
msg_ok "Updated $APP"
|
|
||||||
|
msg_ok "Updated successfully"
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
fi
|
fi
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"name": "Zoraxy",
|
"name": "Zoraxy",
|
||||||
"slug": "zoraxy",
|
"slug": "zoraxy",
|
||||||
"categories": [
|
"categories": [
|
||||||
4
|
4
|
||||||
],
|
],
|
||||||
"date_created": "2024-05-02",
|
"date_created": "2024-05-02",
|
||||||
"type": "ct",
|
"type": "ct",
|
||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 8000,
|
"interface_port": 8000,
|
||||||
"documentation": null,
|
"documentation": "https://github.com/tobychui/zoraxy/wiki",
|
||||||
"website": "https://zoraxy.aroz.org/",
|
"website": "https://zoraxy.aroz.org/",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/zoraxy.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/zoraxy.webp",
|
||||||
"config_path": "",
|
"config_path": "",
|
||||||
"description": "Zoraxy is an all in one homelab network routing solution.",
|
"description": "Zoraxy is an all in one homelab network routing solution.",
|
||||||
"install_methods": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
"type": "default",
|
"type": "default",
|
||||||
"script": "ct/zoraxy.sh",
|
"script": "ct/zoraxy.sh",
|
||||||
"resources": {
|
"resources": {
|
||||||
"cpu": 2,
|
"cpu": 2,
|
||||||
"ram": 2048,
|
"ram": 2048,
|
||||||
"hdd": 6,
|
"hdd": 6,
|
||||||
"os": "debian",
|
"os": "debian",
|
||||||
"version": "12"
|
"version": "12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"default_credentials": {
|
"default_credentials": {
|
||||||
"username": null,
|
"username": null,
|
||||||
"password": null
|
"password": null
|
||||||
},
|
},
|
||||||
"notes": []
|
"notes": []
|
||||||
}
|
}
|
||||||
|
@ -13,15 +13,8 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Zoraxy (Patience)"
|
fetch_and_deploy_gh_release "zoraxy" "tobychui/zoraxy" "singlefile" "latest" "/opt/zoraxy" "zoraxy_linux_amd64"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
curl -fsSL "https://github.com/tobychui/zoraxy/releases/download/${RELEASE}/zoraxy_linux_amd64" -o zoraxy_linux_amd64
|
|
||||||
mkdir -p /opt/zoraxy
|
|
||||||
mv zoraxy_linux_amd64 /opt/zoraxy/zoraxy
|
|
||||||
chmod +x /opt/zoraxy/zoraxy
|
|
||||||
ln -s /opt/zoraxy/zoraxy /usr/local/bin/zoraxy
|
ln -s /opt/zoraxy/zoraxy /usr/local/bin/zoraxy
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
|
||||||
msg_ok "Installed Zoraxy"
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/zoraxy.service
|
cat <<EOF >/etc/systemd/system/zoraxy.service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user