Refactor (#5723)
This commit is contained in:
parent
f7e9fbc473
commit
e5bea1f49a
10
ct/dashy.sh
10
ct/dashy.sh
@ -29,7 +29,7 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Lissy93/dashy/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
RELEASE=$(curl -fsSL https://api.github.com/repos/Lissy93/dashy/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat ~/.dashy 2>/dev/null)" ]] || [[ ! -f ~/.dashy ]]; then
|
||||||
msg_info "Stopping ${APP}"
|
msg_info "Stopping ${APP}"
|
||||||
systemctl stop dashy
|
systemctl stop dashy
|
||||||
msg_ok "Stopped ${APP}"
|
msg_ok "Stopped ${APP}"
|
||||||
@ -43,14 +43,13 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
msg_ok "Backed up conf.yml"
|
msg_ok "Backed up conf.yml"
|
||||||
|
|
||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
|
||||||
rm -rf /opt/dashy
|
rm -rf /opt/dashy
|
||||||
mkdir -p /opt/dashy
|
fetch_and_deploy_gh_release "dashy" "Lissy93/dashy"
|
||||||
curl -fsSL "https://github.com/Lissy93/dashy/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz -C /opt/dashy --strip-components=1
|
|
||||||
|
msg_info "Updating ${APP} to ${RELEASE}"
|
||||||
cd /opt/dashy
|
cd /opt/dashy
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||||
|
|
||||||
msg_info "Restoring conf.yml"
|
msg_info "Restoring conf.yml"
|
||||||
@ -65,6 +64,7 @@ function update_script() {
|
|||||||
msg_info "Starting Dashy"
|
msg_info "Starting Dashy"
|
||||||
systemctl start dashy
|
systemctl start dashy
|
||||||
msg_ok "Started Dashy"
|
msg_ok "Started Dashy"
|
||||||
|
|
||||||
msg_ok "Updated Successfully"
|
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}"
|
||||||
|
@ -14,15 +14,12 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
fetch_and_deploy_gh_release "dashy" "Lissy93/dashy"
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Lissy93/dashy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
msg_info "Installing Dashy ${RELEASE} (Patience)"
|
msg_info "Installing Dashy ${RELEASE} (Patience)"
|
||||||
mkdir -p /opt/dashy
|
|
||||||
curl -fsSL "https://github.com/Lissy93/dashy/archive/refs/tags/${RELEASE}.tar.gz" | tar -xz -C /opt/dashy --strip-components=1
|
|
||||||
cd /opt/dashy
|
cd /opt/dashy
|
||||||
$STD npm install
|
$STD npm install
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
|
||||||
msg_ok "Installed Dashy ${RELEASE}"
|
msg_ok "Installed Dashy ${RELEASE}"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user