mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-07-09 07:27:37 +00:00
23
ct/mafl.sh
23
ct/mafl.sh
@ -27,18 +27,31 @@ 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/hywax/mafl/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/hywax/mafl/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
msg_info "Updating Mafl to v${RELEASE} (Patience)"
|
if [[ "${RELEASE}" != "$(cat ~/.mafl 2>/dev/null)" ]] || [[ ! -f ~/.mafl ]]; then
|
||||||
|
msg_info "Stopping Mafl service"
|
||||||
systemctl stop mafl
|
systemctl stop mafl
|
||||||
curl -fsSL "https://github.com/hywax/mafl/archive/refs/tags/v${RELEASE}.tar.gz" -o $(basename "https://github.com/hywax/mafl/archive/refs/tags/v${RELEASE}.tar.gz")
|
msg_ok "Service stopped"
|
||||||
tar -xzf v${RELEASE}.tar.gz
|
|
||||||
cp -r mafl-${RELEASE}/* /opt/mafl/
|
msg_info "Performing backup"
|
||||||
rm -rf mafl-${RELEASE}
|
mkdir -p /opt/mafl-backup/data
|
||||||
|
mv /opt/mafl/data /opt/mafl-backup/data
|
||||||
|
rm /opt/mafl
|
||||||
|
msg_ok "Backup complete"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "mafl" "hywax/mafl"
|
||||||
|
|
||||||
|
msg_info "Updating Mafl to v${RELEASE}"
|
||||||
cd /opt/mafl
|
cd /opt/mafl
|
||||||
yarn install
|
yarn install
|
||||||
yarn build
|
yarn build
|
||||||
systemctl start mafl
|
systemctl start mafl
|
||||||
|
mv /opt/mafl-backup/data /opt/mafl/data
|
||||||
msg_ok "Updated Mafl to v${RELEASE}"
|
msg_ok "Updated Mafl to v${RELEASE}"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,22 +14,17 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y make
|
$STD apt-get install -y \
|
||||||
$STD apt-get install -y g++
|
ca-certificates \
|
||||||
$STD apt-get install -y gcc
|
build-essential
|
||||||
$STD apt-get install -y ca-certificates
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
|
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
|
||||||
|
fetch_and_deploy_gh_release "mafl" "hywax/mafl"
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/hywax/mafl/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
|
||||||
msg_info "Installing Mafl v${RELEASE}"
|
msg_info "Installing Mafl v${RELEASE}"
|
||||||
curl -fsSL "https://github.com/hywax/mafl/archive/refs/tags/v${RELEASE}.tar.gz" -o "v${RELEASE}.tar.gz"
|
|
||||||
tar -xzf v${RELEASE}.tar.gz
|
|
||||||
mkdir -p /opt/mafl/data
|
mkdir -p /opt/mafl/data
|
||||||
curl -fsSL "https://raw.githubusercontent.com/hywax/mafl/main/.example/config.yml" -o "/opt/mafl/data/config.yml"
|
curl -fsSL "https://raw.githubusercontent.com/hywax/mafl/main/.example/config.yml" -o "/opt/mafl/data/config.yml"
|
||||||
mv mafl-${RELEASE}/* /opt/mafl
|
|
||||||
rm -rf mafl-${RELEASE}
|
|
||||||
cd /opt/mafl
|
cd /opt/mafl
|
||||||
export NUXT_TELEMETRY_DISABLED=true
|
export NUXT_TELEMETRY_DISABLED=true
|
||||||
$STD yarn install
|
$STD yarn install
|
||||||
|
Reference in New Issue
Block a user