Update zoraxy.sh
- breaking change - switch to binary install
This commit is contained in:
parent
64eab60a4c
commit
edf0753120
1 changed files with 16 additions and 18 deletions
34
ct/zoraxy.sh
34
ct/zoraxy.sh
|
@ -20,7 +20,7 @@ header_info
|
||||||
echo -e "Loading..."
|
echo -e "Loading..."
|
||||||
APP="Zoraxy"
|
APP="Zoraxy"
|
||||||
var_disk="6"
|
var_disk="6"
|
||||||
var_cpu="4"
|
var_cpu="2"
|
||||||
var_ram="2048"
|
var_ram="2048"
|
||||||
var_os="debian"
|
var_os="debian"
|
||||||
var_version="12"
|
var_version="12"
|
||||||
|
@ -54,30 +54,28 @@ function default_settings() {
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
if [[ ! -d /opt/zoraxy/src ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -d /opt/zoraxy/ ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "SET RESOURCES" "Please set the resources in your ${APP} LXC to ${var_cpu}vCPU and ${var_ram}RAM for the build process before continuing" 10 75
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
msg_info "Updating $APP"
|
msg_info "Updating $APP to ${RELEASE}"
|
||||||
systemctl stop zoraxy
|
systemctl stop zoraxy
|
||||||
cd /opt/zoraxy/src
|
RELEASE=$(curl -s https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
systemctl stop zoraxy
|
wget -q "https://github.com/tobychui/zoraxy/releases/download/${RELEASE}/zoraxy_linux_amd64"
|
||||||
if git pull | grep -q 'Already up to date.'; then
|
rm /opt/zoraxy/zoraxy
|
||||||
msg_ok "Already up to date. No update required."
|
mv zoraxy_linux_amd64 /opt/zoraxy/zoraxy
|
||||||
else
|
chmod +x /opt/zoraxy/zoraxy
|
||||||
go mod tidy
|
systemctl start zoraxy
|
||||||
go build
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
msg_ok "Updated $APP"
|
msg_ok "Updated $APP"
|
||||||
fi
|
else
|
||||||
systemctl start zoraxy
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
exit
|
fi
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
build_container
|
build_container
|
||||||
description
|
description
|
||||||
|
|
||||||
msg_info "Setting Container to Normal Resources"
|
|
||||||
pct set $CTID -cores 2
|
|
||||||
msg_ok "Set Container to Normal Resources"
|
|
||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${APP} should be reachable by going to the following URL.
|
echo -e "${APP} should be reachable by going to the following URL.
|
||||||
${BL}http://${IP}:8000${CL} \n"
|
${BL}http://${IP}:8000${CL} \n"
|
||||||
|
|
Loading…
Reference in a new issue